How to use IFTTT to integrate the Vivaldi blog (WordPress) with Vivaldi Social (Mastodon)

Applet heading

When you write a blog post, you want to tell your followers that you’ve written it. You can do that automatically with IFTTT. This guide works with any WordPress site and any Mastodon instance, but I’m using the Vivaldi Blogs and Vivaldi Social as example.

What is IFTTT, you may ask? It’s a plattform where you can automate almost anything that is connected to the internet in some form. To follow this guide you need an IFTTT.com account. You can use a free account.

Why am I using IFTTT? Because then I don’t have to install any WordPress plugins to post to Mastodon. If you use a WordPress blog that is hosted at a third party, like Vivaldi.net, you also can’t install any plugins, but IFTTT works anyway 🙂

IFTTT Maker Key

The first thing you need to do, is to find your IFTTT Maker Key. You’ll find it by going to https://ifttt.com/maker_webhooks and click on “Documentation.

Webhooks integrations
Click on Documentation to get your Maker Key

Write it down, you’ll need it in the next step.

Vivaldi Social (Mastodon) app

Now that you have your IFTTT Maker Key, you need to create a Mastodon app. You do that by going to “Settings” and “Development”. If you are on Vivaldi Social, you can use this link.

Now you need to give it a name, in lack of imagination, I just called it “IFTT” (yes, I know I spelled it wrong in the screenshot, it’s a lot of T’s you know…)

For the application website, you use https://maker.ifttt.com/use/[makerkey] with the Maker Key you wrote down in the last step:

Define a Mastadon app
Mastodon app settings

Don’t type anything in the Redirect URI field and make sure the app has “write” privileges.

Before you go back to IFTTT, make sure to write down the access token. You’ll need that in a later step.

Create an IFTTT applet

Now the fun starts, you’ll create your IFTTT applet. With a free IFTTT account you can have up to five applets. This applet that we create will run every few hours to look for new blog posts, if you want it to run more often, I think you need to update the to a paid subscription.

Create a new applet
If this, then that, it’s quite basic really.

Click on “If This” to get started building the applet.

IF This

When you create a new trigger you want to add you blogs feed URL, on Vivaldi Blogs its yourusername.vivaldi.net/feed. You want to trigger on new feed items, like this:

Edit trigger fields
Add a feed

That’s it for the “If this” step. Now you need to tell IFTTT what to do when it triggers.

Then That

Now it gets a little bit more technical. You first must choose an action. You want to create a webhook that makes a web request:

Choose an action
Choose “Make a web request”

Then there are a few fields you must fill out. In URL you must fill out the URL to the status API call in your Mastodon instance followed by the access token you wrote down earlier. Here is the URL if you are using Vivaldi Social:

Make a web request
Post to the status API

Then you choose POST as method. You shouldn’t have to fill out “Content Type”, but if this applet doesn’t work, you can try to set it to «application/x-www-form-urlencoded».

Leave the other fields empty and go down to “Body”. Here you enter what will ultimately become your automated post to Mastodon. You have to start with “status=”.

Any text you want to add should be <<<inside these brackets>>>:

Add text to body
My Mastodon post text

It’s important to note that the Mastodon API rolls over and plays dead if you post anything other than plain text, so don’t use fields that could contain HTML code. I’ve found that fields containing titles and URL’s are safe, like {{EntryTitle}} and {{EntryUrl}}.

That’s it, give the applet a name and you are ready to go:

Review and Finish
Give the applet a title

Now, the bad news is that there is no other way of testing this Applet than to write a new blogpost and wait a few hours. If you did something wrong, fix it, write a new blog post, and wait a few hours more…

So now I hope this works for me 😉

Update 1,5 hours later

Yes, it worked! Almost 1,5 hours after I posted this blog, the post was sent to Mastodon:

How this job looks like as a post on Vivaldi Social
Vivaldi Social post

For some reason, the log at IFTTT claims that the job failed, but it worked just as expected, so I suspect it was just a glitch in the matrix 😛

Comment

Your email address will not be published.