{"id":29628,"date":"2022-12-14T19:10:38","date_gmt":"2022-12-15T03:10:38","guid":{"rendered":"https:\/\/mikeindustries.com\/blog\/?p=29628"},"modified":"2022-12-18T12:09:28","modified_gmt":"2022-12-18T20:09:28","slug":"how-to-automatically-post-your-tweets-to-mastodon","status":"publish","type":"post","link":"https:\/\/mikeindustries.com\/blog\/archive\/2022\/12\/how-to-automatically-post-your-tweets-to-mastodon","title":{"rendered":"How to Automatically Post your Tweets to Mastodon"},"content":{"rendered":"<p>Over the last several weeks, I&#8217;ve gotten in the habit of trying to <a href=\"https:\/\/macaw.social\/@mikeindustries\">move all of my Twitter activity over to Mastodon<\/a> instead. I signed up for Mastodon several years ago, but only now are there enough people using it for it to replace a lot of what you might use Twitter for. <a href=\"https:\/\/www.movetodon.org\">Some of your friends<\/a> are there, some of your favorite bots are there, and some news sources are there. What more do you need in life, really?<\/p>\n<p>I&#8217;ve been using <a href=\"https:\/\/pinafore.social\">Pinafore<\/a> (along with <a href=\"http:\/\/mikeindustries.com\/scritch\/cleanafore.css\">a user stylesheet I created<\/a>&#8230; feel free to grab it for yourself) to use Mastodon on the web, and a combination of <a href=\"https:\/\/testflight.apple.com\/join\/2bauS53v\">Ivory<\/a> and <a href=\"https:\/\/apps.apple.com\/us\/app\/metatext\/id1523996615\">Metatext<\/a> on my iPhone. Ivory looks a bit nicer but Metatext has a Notifications tab that acts more you&#8217;re used to it working on Twitter.<\/p>\n<p>If you want to move all of your activity over wholesale, go to town. If, however, 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&#8217;s mostly just clicking around on a couple of websites.<\/p>\n<p><strong>Important:<\/strong> If you do this, the goal should not be just replicate your Tweets and never visit or engage on Mastodon. The goal should be to help you build your Mastodon presence and save you from having to manually double-post. Ideally you quickly get to the point where Mastodon becomes your primary crib.<\/p>\n<h3>Step 1: Open a Mastodon account<\/h3>\n<p>If you&#8217;ve already done this, great. If you haven&#8217;t, head to any server you want \u2014 like <a href=\"https:\/\/mastodon.social\">mastodon.social<\/a>, for instance \u2014 and set up your account. You can always switch your server (along with any followers you accrue) later, so don&#8217;t stress about the server you choose.<\/p>\n<p><!--more--><\/p>\n<h3> Step 2: Open an IFTTT account<\/h3>\n<p>IFTTT (&#8220;If This Then That&#8221;) 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 <a href=\"https:\/\/ifttt.com\">IFTTT.com<\/a> and set up a free account for yourself.<\/p>\n<h3>Step 3: Get your Mastodon posting URL<\/h3>\n<p>Head over to your Mastodon account on the web and choose &#8220;Preferences&#8221; in the lower right corner. Then choose &#8220;Development&#8221; at the bottom of the left navigation. Then choose &#8220;New Application&#8221; in the upper right. Under &#8220;Application Name&#8221;, type in whatever you want&#8230; something like <code>IFTTT<\/code>. Under &#8220;Application website&#8221;, type in <code>https:\/\/ifttt.com<\/code>. Leave the &#8220;Redirect URI&#8221; field alone, and make sure *only* the <code>write:statuses<\/code> box is checked. Hit the Submit button at the bottom of the screen, and then click the name of your application (e.g. <code>IFTTT<\/code>) on the resulting screen. Now open a new tab in your browser, leaving this page available for later.<\/p>\n<h3>Step 4 (Final step!): Connect your IFTTT account to your Twitter and your Mastodon accounts<\/h3>\n<p>Head back over to IFTTT.com and hit the &#8220;Create&#8221; button in the upper right. Click the big &#8220;If This&#8221; button, search for &#8220;Twitter&#8221;, and then click it. Scroll down and choose &#8220;New Tweet by a specific user&#8221;. 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 &#8220;Create Trigger&#8221;. Now click &#8220;Then That&#8221; and search for &#8220;Webhook&#8221;. There should be a tile on the resulting page that says &#8220;Make a web request&#8221;. Click that. You&#8217;re almost done. For the fields, enter the following:<\/p>\n<p>URL:<br \/>\n<code>https:\/\/mastodon.social\/api\/v1\/statuses<\/code> (replace &#8220;mastodon.social&#8221; if you chose a different server above)<\/p>\n<p>Method:<br \/>\n<code>POST<\/code><\/p>\n<p>Content Type:<br \/>\n<code>application\/x-www-form-urlencoded<\/code><\/p>\n<p>Additional Headers:<br \/>\n<code>Authorization: Bearer AccessToken<\/code> (replace the word &#8220;AccessToken&#8221; with the access token from the one on the Mastodon page you left open above)<\/p>\n<p>Body:<br \/>\n<code>status={{Text}}<\/code> (Everything inside those brackets is the content of the Tweet&#8230; you could prepend some custom text right after the equals sign if you wanted)<\/p>\n<p>Now hit the big &#8220;Create Action&#8221; button, then the &#8220;Continue&#8221; button, then the &#8220;Finish&#8221; button, and BOOM, you&#8217;re done!<\/p>\n<p>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.<\/p>\n<p>I encourage you to move your primary posting and reading activity over to Mastodon, but this is a good baby step if you&#8217;re not quite ready for that yet. It&#8217;s also a great way to set up news bots. We need more of those. You can follow the Axios newsbot I created <a href=\"https:\/\/mastodon.social\/@axios\">here<\/a>, or you can <a href=\"https:\/\/macaw.social\/@mikeindustries\">follow me on Mastodon here<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Over the last several weeks, I&#8217;ve gotten in the habit of trying to move all of my Twitter activity over to Mastodon instead. I signed up for Mastodon several years ago, but only now are there enough people using it for it to replace a lot of what you might use Twitter for. Some of [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":29635,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[41,282,39,473],"tags":[],"class_list":["post-29628","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-business","category-original","category-technology","category-twitter"],"_links":{"self":[{"href":"https:\/\/mikeindustries.com\/blog\/wp-json\/wp\/v2\/posts\/29628","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mikeindustries.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mikeindustries.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mikeindustries.com\/blog\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/mikeindustries.com\/blog\/wp-json\/wp\/v2\/comments?post=29628"}],"version-history":[{"count":18,"href":"https:\/\/mikeindustries.com\/blog\/wp-json\/wp\/v2\/posts\/29628\/revisions"}],"predecessor-version":[{"id":29647,"href":"https:\/\/mikeindustries.com\/blog\/wp-json\/wp\/v2\/posts\/29628\/revisions\/29647"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/mikeindustries.com\/blog\/wp-json\/wp\/v2\/media\/29635"}],"wp:attachment":[{"href":"https:\/\/mikeindustries.com\/blog\/wp-json\/wp\/v2\/media?parent=29628"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mikeindustries.com\/blog\/wp-json\/wp\/v2\/categories?post=29628"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mikeindustries.com\/blog\/wp-json\/wp\/v2\/tags?post=29628"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}