# Tootbot for Mastodon

DevFeed: [Tootbot for Mastodon](<https://devfeed.tech/articles/tootbot-for-mastodon-25350.md>)

Original publisher: [Read original article](<https://kau.sh/blog/toot-bot-post-mastodon-automatically-kotlin-script/>)

Author: Kaushik Gopal

Published: 2023-02-04T03:00:00Z

Content type: tutorial

Language: en

Sources: [Kaushik Gopal's Site](<https://devfeed.tech/sources/kaushik-gopal-s-site.md>)

Topics: [Mastodon](<https://devfeed.tech/topics/mastodon.md>), [Kotlin](<https://devfeed.tech/topics/kotlin.md>), [Script](<https://devfeed.tech/topics/script.md>), [Shell](<https://devfeed.tech/topics/shell.md>), [CSV](<https://devfeed.tech/topics/csv.md>), [JSON](<https://devfeed.tech/topics/json.md>), [Homebrew](<https://devfeed.tech/topics/homebrew.md>), [Mac Mini](<https://devfeed.tech/topics/mac-mini.md>)

Tags: [blog](<https://devfeed.tech/tags/blog.md>), [github](<https://devfeed.tech/tags/github.md>), [install](<https://devfeed.tech/tags/install.md>), [json](<https://devfeed.tech/tags/json.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [local](<https://devfeed.tech/tags/local.md>), [mac-mini](<https://devfeed.tech/tags/mac-mini.md>), [script](<https://devfeed.tech/tags/script.md>), [shell-script](<https://devfeed.tech/tags/shell-script.md>)

## AI overview

A Kotlin shell script running on a Mac Mini uses a cron job to announce new blog posts on Mastodon. It downloads the blog's JSON feed, checks for new posts, compares them with a local CSV record of previous toots, and publishes announcements. The article also gives Homebrew installation and execution commands.

## Source excerpt

Every time I create a new post in this blog I like to toot or tweet about it. Instead of manually doing this, I have my Mac Mini run a little shell script on a cron job, that does this automatically for me. You can download the source for this script over at github. The way it works is pretty simple: Download my latest blog feed as a json file. Check for any new blog posts. Compares with a local CSV file that records previous toots. Posts new toots to Mastodon1 Running the script is trivially easy (and it's all in Kotlin) so it's easy to follow the logic. All you need to do to run this script is: brew install kotlin kotlin tootbot.main.kts That's it! Just remember to update the variables at the top of the file. Not doing Twitter for obvious reasons. ↩︎