Step 4 - Sending Webmentions using Webmention.app and IFTTT

Posted

We’ve previously enabled our site to receive Webmentions, but what can we do about sending Webmentions to other sites? As I explained in the last article, Texpattern doesn’t have this capability built-in, so we will need to use a plug-in, external service, or possibly some combination of the two.

My original intent for sending Webmentions was to write a small plug-in which would handle this, but thanks to a new service created by Remy Sharp, I don’t have to! Much like we use Webmention.io to handle receiving Webmentions, we’re going to use Webmention.app to handle the sending. And the best bit is, we don’t need to make any modifications to our site!

Prerequisites

To set up sending Webmentions from your Texpattern site, you will need the following:

  • A GitHub account, to obtain a user token for Webmention.app.
  • An IFTTT account, so we can trigger an action whenever our site’s RSS or Atom feed is updated.

Get Your Webmention.app Token

To make sure the service isn’t overwhelmed by robot accounts, Webmention.app institutes rate limits for requests without a user token. To ensure we won’t run into those limits, it’s best to obtain your own token.

Head over to the Token page on Webmention.app, and click on the ‘Sign In with GitHub’ button.

Once authenticated, you will be redirected back to the Token page, which now shows your unique token.

Keep hold of your token for now – copy it to a text file, or open a new tab and leave Webmention.app in the background.

Get Your Feed Address

This one is simple. You just need to decide which format you want to use – RSS, or Atom. Personally, I went with Atom, but either will work just as well as the other.

The URL will be in the form http://your.site.com/rss/, or http://your.site.com/atom/. For example, mine are:

  • https://txp.kpw.fyi/rss/ for the RSS feed.
  • https://txp.kpw.fyi/atom/ for the Atom feed.

Create the IFTTT Applet

The last thing we need to do is create the IFTTT applet. This applet will trigger every time a new item appears in the site feed, running a webhook which will trigger Webmention.app to check the article URL, parse it, and send any Webmentions.

The Webmention.app documentation covers the steps to setting up IFTTT here, but I’ve repeated the steps below with screenshots for convenience.

Step 1

Start by creating a new applet on ifttt.com. Click on +this and select RSS Feed:

Step 2

Select New feed item and enter the URL to your feed:

Step 3

Click on +that and find and select Webhooks:

Step 4

For the URL, enter: https://webmention.app/check?url={{EntryUrl}}&token=[your-token] (replace [your-token] with your Webmention.app token. Don’t replace {{EntryUrl}}) Change the method to POST:

Step 5

Then click Create action then Finish. You don’t need to set any of the other options.

Wrap-up

Whenever you post a new article to your Textpattern site, IFTTT should pick it up and notify Webmention.app to do its thing. Super simple, and super helpful! You can use this method to add sending Webmentions from any website so long as it publishes an RSS or Atom feed.

Author

Mentions