💾 Archived View for ruario.flounder.online › journal-extract-2024-08-23-1551.gmi captured on 2024-08-25 at 00:23:21. Gemini links have been rewritten to link to archived content

View Raw

More Information

-=-=-=-=-=-=-

Ruario's Journal [extract]

2024-08-23

15:51 +0200

Basic Mastodon bots

So I have a couple of Mastodon "bots" (automated accounts). They do not do much. They just watch for newer version of various software and post if something appears. An example being the following which tracks a handful of desktop web browsers:

@browserversiontracker@vivaldi.net

I just thought I would explain how it works as it is actually fairly simple. I located various public sources for the current version number for a given piece of software. For Google I would use the Google versions json information and construct a URL like this.

Google Linux stable versions [json]

Or for Firefox versions I would use this.

Firefox versions [json]

Once I have good sources of reliable information for all the software I wish to track I setup a shell script that pulls them using curl. This information is then parsed with local tools. That can be a tool dedicated to the format the information is published in or at a push I could just use a regex to extract what I need with things like grep and sed. Once I have version numbers for each software I compare them with file on disk that has the version numbers I already knew about. If there are any new versions a post is created and posted with Toot TUI and I update the local file.

Toot - a Mastodon CLI client

There is a little error handling (e.g. for cases where I have trouble getting information due to stuff like network problems) but basically… that's it!

At the end of the day it is the authors of the various tools I use who have done all the hard work, I just tie it all together with "duct tape" (well a tiny shell script) that is run regularly on a cron job from my work machine (since that is always on anyway).

I don't know if this is helpful to anyone, or if anyone will ever read this but if it is and you do, there you go. 😉

📝 Journal [complete]