Using IFTTT to post to Mastodon

On moving from Twitter to Mastodon as my main microblogging platform I was keen to set up a couple of integrations via IFTTT (If This Then That) – one to automatically post my public Flickr photos (with the description as the image description aka alt text) and another to post when I blog.

Unfortunately the former isn’t possible (yet?) as apparently posting an image to Mastodon is a two-stage process and IFTTT automation can only handle a single step. However I’ve managed to set up a simple post with the title, description and a link to the image page on Flickr, and a similar new blog post notification from this WordPress site.

Full disclosure: very little in this post is original! I highly recommend Matthias Ott’s post on Syndicating Posts from Your Personal Website to Twitter and Mastodon [Syndicating to Mastodon section] which got me most of the way there, and the post he referenced by Kelson Vibber (How to Post to Mastodon From Anything Using IFTTT) covered the rest.

Rather than replicate their work in detail, first I’ll very briefly outline the steps as covered by them, then say a bit more about formatting the post itself.

Linking IFTTT to Mastodon

  1. Set up IFTTT Webhooks and look up the full URL of your Webhook via Webhooks Settings.
  2. Use your Webhook URL to add this application to your Mastodon account via https://[your instance URL]/settings/applications/ – only tick 'write:statuses', it doesn’t need access to anything else.
  3. Copy the access token this generates.
  4. Set up a trigger for your IFTTT applet as usual and when choosing the ‘then that’, select Webhooks.
  5. Use the following settings:
    • URL = https://[your instance URL]/api/v1/statuses?access_token=[your access token]
    • Method = POST
    • Content type = application/x-www-form-urlencoded
  6. Body – this is where it gets interesting!

Formatting your post

First click ‘Add ingredient’ to see what fields are available to you. Whichever you add, it seems best to surround any of them with <<< >>> which escapes any special characters to ensure they display correctly.

At a minimum, start the body with status=<<< {{your ingredient of choice}} >>>. You can do more e.g. use a content wrapper/warning using 'spoiler_text=', just remember to put an ampersand (&) between each part of the post. Kelson’s post gives some nice examples.

For Flickr I ended up with the below – the yucky-looking variables were easily inserted via ‘add ingredient’.

spoiler_text=Flickr crosspost - <<<{{Flickr.anyNewPublicPhoto.Title}}>>>&status=<<<{{Flickr.anyNewPublicPhoto.Description}}>>>  <<<{{Flickr.anyNewPublicPhoto.FlickrUrlShort}}>>>

For WordPress I used the following (with the WordPress integration rather than RSS):

status=New blog post: <<< {{PostTitle}}>>> <<< {{PostUrl}}>>>

Testing

I’m a free IFTTT user and found the ‘check now’ button to try and run the applet straight away didn’t seem to do much. In the end I published a new blog post/uploaded a photo and had to Just Be Patient! First time round the widget didn’t fire at all; I suspect because I went in and edited the settings after doing something that would trigger it, but before it had fired. Second time round all went very well :) You can enable notifications when applets run in IFTTT so you know when to check your Mastodon posts.

Final thoughts

Matthias discusses the etiquette of cross-posting at all, and Kelson mentions the importance of only doing this with triggers that you control. Otherwise you’re essentially creating a bot account and need to use an appropriate instance, consider the ethics of doing so, etc.

I’m not sure how useful it is to post a link to Flickr rather than the image itself; longer-term I ought to check out Pixelfed but I have a huge archive of photos on Flickr now.

I’m also wondering if there’s cleverer and more sophisticated uses of this integration. There’s a syntax to post a draft for manual editing/publishing which could be a nice way to set up a workflow for more selective sharing. In fact I just found that adding a blog post to Feedly’s ‘save for later’ list is a possible trigger which is very interesting, but IFTTT integration requires Feedly Pro at $8 a month. Now where have I heard that price point recently?!

Mastodon tips for Twitter users

Well look at me, blogging like it’s 2009 or something.

I spent a fair chunk of time over the weekend learning about Mastodon then signing up for an account as an insurance policy in case Twitter goes permanently south under the stewardship of Elon Musk. Now I’m on there I’m wondering how much to stay on Twitter even if it recovers as so far Mastodon / the Fediverse is a pleasingly retro experience.

Anyway, I thought I’d share a few useful things I learned about Mastodon along the way. One or two could seriously catch out people used to how Twitter works. Caveat: it’s quite possible I’ve got things wrong and welcome any (polite) corrections.

If you’re starting from scratch with Mastodon and the Fediverse like I was last week, I *highly* recommend fedi.tips for a user-friendly guide to getting started.

Choosing a server

I really don’t have the answers on this one! I’ve seen arguments for choosing big and small servers (in terms of user numbers) – the former is less likely to close down and lose your data, the latter more likely to be able to cope with moderation etc. Personally I went for a smallish server with a few thousand users.

I mostly stuck to servers listed at JoinMastodon.org as these have agreed to give three months’ notice before closing down. I also checked the code of conduct wasn’t too loose or too strict, and that they had blocked other servers with notoriously bad-behaved users. Some servers seem very strict on content so this is worth checking out. Finally I looked for some way to contribute financially as feel very nervous that server admins asserting ‘we’re fine, we’ll keep this running’ might not feel the same post-influx!

In case it helps, here is my entirely unscientific list of English-language servers that I considered joining based on the criteria above:

Cross-posting

I’m using Moa.party which feels vary bare-bones but seems to work well with just a slight delay. You log in with your Mastodon and Twitter accounts, choose your options, then their server automatically crossposts based on your settings. You can post from whatever interface you like.

Privacy is set per-post, not per-account

This has two important consequences:

  1. You can’t lock down your whole account at once. You can turn on follower approval at any time but your old posts will remain public, unless you always posted at ‘followers-only’ privacy level. To create the equivalent of a locked Twitter account you’ll need to do both from the start. Like on Twitter, you can mute conversations so that may be a way to silence an unwelcome viral post.
    Read more about post privacy on fedi.tips
  2. The equivalent of DMs are posts set to be visible only by those tagged. So if you only tag one person, only they can read it (plus the server admin, but that’s true of literally any service that isn’t end-to-end encrypted). But if you mention someone else in your message and tag them, they can see the message too, and I assume are notified of it! 😱 Thanks to Kieran Healy for highlighting this.

Design choices to reduce negative interactions

There are several design decisions which I found very surprising having come from Twitter. They are at least partly aimed to improve the typical user’s experience:

  1. Search only finds hashtags and doesn’t do full-text post searching
  2. There’s no such thing as a quote tweet equivalent to avoid people getting piled-on
  3. It’s very easy to put a post behind a content warning which is a great way to let people choose if they want to view or engage with certain content. Apparently standard etiquette is to do this with anything ‘political’ and certainly when sharing the awful. I get it for the latter but have Thoughts about the former – who gets to decide what is political and whose voices may be hidden? It’ll be interesting to see how this develops as the community expands and includes more journalists and others posting nothing but political content.

Data loss risks

Your posts are all stored on the server you chose when you signed up. You can migrate your account to a new server, keep your followers, set up a redirect from your old account, and easily export and import who you’re following. However your old posts stay on your old server and if it goes down, so do they. As a result I think you either need to treat your content as ephemeral, or download an archive regularly.

In addition, if you decide to delete your account, there’s no going back. Once it’s gone, it’s gone, and no-one can reuse your old username on that server. That includes you.