Crosspost between Twitter and Mastodon

If you want to keep publishing Tweets on Twitter and have them automatically publish to your Mastodon account as well, this short guide is for you. The entire process should take around five minutes. It’s mostly just clicking around on a couple of websites:

Step 1 – Open Mastodon account

If you’ve already done this, great. If you haven’t, head to any server you want — like mastodon.social, for instance — and set up your account. You can always switch your server (along with any followers you accrue) later, so don’t stress about the server you choose.

Step 2 – Open an IFTTT account

IFTTT (“If This Then That”) is a freemium service that lets you automate things on the internet. You can use the free account for now. The only difference for our purposes is that the free account will only poll your Twitter account for new Tweets once an hour. This is only a problem if you Tweet a lot per hour because they will all get posted to Mastodon in batches, once an hour. If this becomes a problem, you can always upgrade to the paid version for two bucks a month. For now, head over to IFTTT.com and set up a free account for yourself.

Step 3 – Get your Mastodon posting URL

Head over to your Mastodon account on the web and choose “Preferences” in the lower right corner. Then choose “Development” at the bottom of the left navigation. Then choose “New Application” in the upper right. Under “Application Name”, type in whatever you want… something like IFTTT. Under “Application website”, type in https://ifttt.com. Leave the “Redirect URI” field alone, and make sure *only* the write:statuses box is checked. Hit the Submit button at the bottom of the screen, and then click the name of your application (e.g. IFTTT) on the resulting screen. Now open a new tab in your browser, leaving this page available for later.

Step 4 – (Final step!): Connect your IFTTT account to your Twitter and your Mastodon accounts

Head back over to IFTTT.com and hit the “Create” button in the upper right. Click the big “If This” button, search for “Twitter”, and then click it. Scroll down and choose “New Tweet by a specific user”. Choose your own Twitter account and IFTTT will perform the necessary authorization. Then, type the username to monitor (in this case, your own), and hit “Create Trigger”. Now click “Then That” and search for “Webhook”. There should be a tile on the resulting page that says “Make a web request”. Click that. You’re almost done. For the fields, enter the following:

URL

https://mastodon.social/api/v1/statuses

(replace “mastodon.social” if you chose a different server above)

Method

POST

Content Type

application/x-www-form-urlencoded

Additional Headers

Authorization: Bearer AccessToken

(replace the word “AccessToken” with the access token from the one on the Mastodon page you left open above)

Body

status={{Text}}

(Everything inside those brackets is the content of the Tweet… you could prepend some custom text right after the equals sign if you wanted)

Now hit the big “Create Action” button, then the “Continue” button, then the “Finish” button, and BOOM, you’re done!

The next time you Tweet, within an hour, it should appear on Mastodon. If you upgrade your IFTTT account, it should lag by only a few minutes.

Stay in the Loop

Get the weekly email from TechLifeTravel that makes reading the news actually enjoyable. Join our mailing list to stay in the loop to stay informed, for free.

LATEST ARTICLES