Auto-Posting to Mastodon via IFTTT
Posted on by Bob Matyas
In the past, auto-posting to Twitter was an easy low-effort way to increase the visibility of content published on your own website. However, in recent months, Twitter has turned off this capability by restricting access to its API.
This – along with the general way in which Twitter has been declining since Elon Musk’s purchase – has prompted many to either abandon Twitter altogether or supplement their Twitter usage by joining Mastodon. If you previously auto-posted content to Twitter, auto-posting to Mastodon can be a way to increase traffic to your site.
Depending on the platform you use, there are different ways to do this. For example, if you run WordPress, you could add a plugin to handle auto-posting to Mastodon. However, you can also do this taking your site’s RSS feed and using it to auto-post to Mastodon via the automation tool IFTTT (If This Then That). This doesn’t require any code or additional dependencies and works with any publishing platform that uses RSS.
Create an App on Mastodon
- Go to “Settings > Development”
- Click on “Add an App”
- Give the app a name, i.e. “RSS to Mastodon”
- Under “Scopes” remove the default global permissions and add “write:statuses”
- Click “Save”
You will then have a new app with client key, client secret, and an access token. You will need the access token in the next section, so keep the window open.
Create an App on IFTTT.com
- Go to “Create” an applet
- Click “Add” on “If This” and under “Choose a Service” search for “RSS Feed” and click on that
- On the next screen – “Choose a Trigger” – select “New Feed Item”
- Add the address of the RSS feed you want to auto-post from to the “Feed URL” field.
- Once you do that click “Add” next to “Then That”
- Search for “webhooks” and click on that
- Select “Make a Web Request” and click on “Connect” on the next screen
- On the “Complete Action Fields” screen, add the address:
INSTANCE_URL_HEREwith the address of your instance, i.e., mastodon.online
- For the “Method”, select “Post”
- For the “Content Type”, select
- For the “Additional Headers” field, add
Authorization: Bearer YOUR_MASTODON_ACCESS_TOKENand replace
YOUR_MASTODON_ACCESS_TOKENwith the access token that you created in the first half of the instructions
- For the “Body” field, add
- Click “Create Action”
- On the next screen, click “Continue”
- Edit the “Applet Title” to be something descriptive like “RSS to Mastodon”
- I recommend turning on “Receive notifications when applet runs”
- Click “Finish”
Now, next time you publish to your website, your Mastodon account will automatically post a link to your new post.