Getting and Displaying a Mastodon Post in Client-Side JavaScript

I’ve got a few pages here that are primarily built for my own use. One of them, my bots page, is a list of all the dumbsuper useful bots I’ve built for Mastodon (and Bluesky). The idea on this page is to show the latest post from each bot. The bots page makes use of two different shortcodes written in Liquid to do this. The first uses the RSS feed of the bot to get their last toot ID: const lastToot = async (instance, user) => { let rssFeedURL = `https://$ {instance}/users/$ {user}.rss`; try { let feed = await parser.parseURL(rssFeedURL); return feed.items[0].guid.split('/').pop(); } catch(e) { console.log(`getting last toot for $ {user} returned an error`); return... more →
Posted in: JavaScript

An Online Mastodon Archive Viewer

Here’s a quick write-up of something I actually built a week or so ago… and forgot to share on the blog. Instead, I shared a way to integrate your Mastodon with Eleventy. In that post, I mentioned how the account Fedi.Tips was looking for ways to let people view their archived Mastodon data. I followed their guide on getting my export and started work on a simple viewer. If you don’t care about the "how", and have your archive ready, just head on over to https://tootviewer.netlify.app and upload your zip. The Archive # When you get your Mastodon archive, it will be a zip file containing the following: actor.json: A file related to the user, yourself probably. avatar.jpg:... more →
Posted in: JavaScript

Building a Web Version of Your Mastodon Archive with Eleventy

A couple of days ago Fedi.Tips, an account that shares Mastodon tips, asked about how non-technical users could make use of their Mastodon archive. Mastodon makes this fairly easy (see this guide for more information), and spurred by that, I actually started work on a simple(ish) client-side application to support that. (You can see it here: https://tootviewer.netlify.app) This post isn’t about that, but rather, a look at how you can turn your archive into a web site using Eleventy. This is rather rough and ugly, but I figure it may help others. Here’s what I built. Start with a Fresh Eleventy Site # To begin, I just created a folder and npm installed Eleventy. I’m using the... more →
Posted in: JavaScript

Automating Mastodon Postings with ColdFusion

I’ve had a lot of fun building Mastodon bots (see my list of super-important business critical bots as an example), typically using the Pipedream platform, and more recently, Cloudflare Workers. The Mastodon API is kinda stupid easy and with "The Other Network" going to hell in a handbasket, I don’t see myself building bots anywhere else. Just yesterday I came home from the Adobe ColdFusion Summit and I thought it would be fun to see how easy it would be to build a Mastodon bot in ColdFusion. Here’s what I was able to do in roughly ten minutes. First, don’t forget that to add automation to a Mastodon account, you need to go into your preferences, select the "Development"... more →
Posted in: JavaScript