In the past I have suggested using Power Automate to send updates to Twitter when ever you have new blog posts. This works by creating flows that check for new entries in my RSS feed, then giving the Power Automate tool permission to send tweets to my Twitter account. It works well for me, however, now that Mastodon is a thing I am trying to avoid manually double posting.

So how do you send updates to Mastodon? Mastodon supports a bunch of APIs that rely on Bearer tokens, so the first thing to do is grab the Bearer token. You can define a new token in settings/application page of your instance.

To publish a new status you would use the aptly named statuses end point, for my instance (dotnet.social) it would be found here: https://dotnet.social/api/v1/statuses. You could use a tool like curl to do this from a CLI, but this blog post is about automation, so I would suggest using IFTT. There is lots of documentation on creating a new Applet, basically you need a to trigger if a new feed is detected then you want to make a web request. ifft-rss-make-web-request

Make a web request to Mastodon

To execute a web request using IFTT you need to define the following items in the Applet:

  • URL (update for your instance): https://dotnet.social/api/v1/statuses
  • Method: POST
  • Content Type: application/x-www-form-urlencoded
  • Additional Headers: Authorization: Bearer
  • Body (the “status=” prefix is required): status=New post: <<<{{EntryTitle}}>>> <<<{{EntryUrl}}>>>

That should just about do it!

Why not use Power Automate? I am a fan for Power Automate but using a webhooks is a premium feature I did not want to pay for, and IFTT provides web hooks for free and is really easy to use. The only downside of IFTT I could find is that it only checks your RSS updates on an hourly basis.



Comment Section