Working with the Mastodon API in BoxLang

So remember a long time ago (Tuesday), when I blogged about using the Bluesky API with BoxLang? As expected, I’m following that up today with a look at using the Mastodon APIs. Personally, I’m down to just two social networks, Bluesky and Mastodon. Originally I was using Mastodon a lot more, but I’ve been vibing with Bluesky more lately so I tend to check it more often. That being said, whenever I release a new blog post, I’ve got an automated process to post to both, so I thought I should cover both for BoxLang as well. Even better… I already did this in ColdFusion! Way back in October 2023, I blogged about the topic and even shared a simple ColdFusion component... more →
Posted in: JavaScript

Working with the Bluesky API in BoxLang

I’ve built multiple integrations with the Bluesky API, all making use of either the Node or Python SDK, but I thought I’d take a quick look at what it would take to build a BoxLang integration using the REST API. Turns out it’s pretty easy (with some caveats I’ll explain at the end) – here’s what I built. Authentication To authenticate, you’ll need your username and password for your account. I’m picking this up via environment variables and doing a bit of validations: BS_HANDLE = server.system.environment?.BLUESKY_HANDLE ?: ''; BS_PASSWORD = server.system.environment?.BLUESKY_PASSWORD ?: ''; if(BS_HANDLE == "" || BS_PASSWORD == "")... more →
Posted in: JavaScript

BoxLang Quick Tips – Working with JSON

Welcome to another BoxLang quick tip – today I’m going to focus on working with JSON in BoxLang. Now, as you can probably guess, JSON is natively supported and supports what you would expect, going to and from JSON, but there’s some particularities of the support that may interest you, so I’ve dug into it. As with my other quick tips, you can skip to the video version at the bottom if you prefer. The Basics Converting data to JSON can be done two ways, either via the built in function (BIF) jsonSerialize or the member function toJSON. There’s no difference here, just use what makes sense for you: name = "Raymond"; age = 52; hobbies = ["beer","books","movies","video... more →
Posted in: JavaScript

Working with Pasted Content in JavaScript

This began as me wanting to build an Alpine.js application that handled pasted input, but I realized before I looked into handling this with Alpine, it made sense to start with basic vanilla JavaScript at first. I’ve worked with the clipboard before, mainly storing information to it, but this was the first time I looked at handling input from the clipboard. The web platform handles it rather nicely, but as with most things, there are a few interesting things you need to be aware of. Here’s what I found. Listening To the Event # The first thing you need to do is actually listen to the event. While you probably listen on a part of a DOM, it made the most sense to me to listen at the... more →
Posted in: JavaScript

Working with the Storage API

Earlier this year at WWDC, Apple announced a whole set of new features coming to Safari in version 17. While that is not out yet, it’s still a pretty large set of updates. I’ve not been shy about my view that Safari has been holding the web back for a while, but I’m happy for any improvements that show up. While looking at the long list of updates, I saw Storage mentioned: WebKit has made some big updates to the storage quota policy. Previously, an origin had a starting storage limit of 1 GB. When exceeding the limit, the subsequent storage operation would fail in Home Screen web apps, or the user would see a prompt asking to increase the quota for the origin in Safari. Starting... more →
Posted in: JavaScript

Working with CloudCannon and Eleventy – My Experience

I’ve been working with the Jamstack (in its various iterations and names) for many years now. In that time, one area I had not really looked into is the use of a content management system (CMS). I recently had a chance to look into how CloudCannon adds CMS capabilities to Eleventy and I thought I’d share my experience. I went in, admittedly, a bit concerned. One of Eleventy’s greatest strengths is its flexibility. Unlike other Jamstack solutions that have a proscribed way of doing things, Eleventy is incredibly open to how it can be used to build a site. My assumption was that it would be difficult for a CMS to "grok" a particular Eleventy implementation and support... more →
Posted in: JavaScript

Working with Algolia’s Crawler

I’ve been using Algolia on my blog for a while now. It’s an excellent search solution for the Jamstack and I absolutely recommend it, especially for sites where the size means Lunr may not be appropriate. While I like Algolia a lot, I haven’t really dug terribly deep into it. I went through multiple iterations of my implementation here to help deal with the size of my content and so forth, but outside of that, I kept the actual search experience nice and simple. This week, I gave a talk at the Jamstack_Berlin user group on search options for the Jamstack and that’s got me thinking more about both Lunr and Algolia. One of the things... more →
Posted in: JavaScript
1 2