Webmentions through the RSS feed

I was asked through the email, how am I accessing the webmentions through the RSS feed. Since this might be a question that more people have, I decided to adopt my answer into a post. For the context, I am using static site generator Nikola. The person asking me was using the ClassicPress. So I will show the way of how to do it for both.

To receive webmentions, I am using the Webmention.io. And they offer the HTML and RSS feed of the received webmentions by default.

For receiving webmentions through webmention.io, this are the steps that one would need to do.

  1. In order to create an account, you need to set up your site serve as a login identification. This means, that you need to link with the rel=me to one of the services. The easiest way I know is to provide the correctly marked email. Go to where you can also change the HTML for the text of your main site. The one that is on the domain without any subpage. For me, this is https://sarajaksa.eu. You go to the text, and somewhere paste the
    <a href="mailto:name@example.com" rel="me">name@example.com</a>
    . Change the email name@example.com with you actual email you have access to. Choose a place, where it would be naturally to have email displayed.
    • In Nikola I use the markdown pages. So I can just add the HTML in the page and it will work.
    • If you are using Wordpress, you can use the IndieWeb plugin to list the identities you use in other places. They provide additional fields in the Edit your profile page in the WordPress. There you can add the ones that you use. For example, in the past I used GitHub in this way.
  2. Go to Webmention.io and login with your domain. This will also create an account for you.
  3. To receive webmentions, you need to add a following code in the head of your page:
    <link rel="webmention" href="https://webmention.io/example.com/webmention" />
    . This is usually in the template part, since you want it on any page you want to receive webmentions for.
    • In Nikola, this can be find in the templates. I think I did not change the folders from default, so it should be in the folder themes > blog > templates. Open the file base_helper.tmpl. There is a function html_headstart(). Add it somewhere there.
    • If you are using Wordpress, you can use Insert Headers and Footers. There is a Code Snippets option in the plugins page. There pick Add New. Choose the option Add Your Custom Code (New Snippet). Copy in the Code Preview and save. You only need the free features of this plugin, so no need to buy it.

Now you are able to receive the Webmentions through the service. You can find the link to the RSS feed in the the Settings page, under Mentions Feed. There is a code that looks like a link. It will look something like that: https://webmention.io/api/mentions.atom?token=random-string . The random string part is the API key, that is also listed below under API Key heading. That link is your RSS feed with all received webmentions to the domain since setting the service.

The RSS feed only provides the link to the replies. Since I prefer to see the reply text if possible, I instead you the HTML feed and send it through the Granary. I take the HTML link instead, which is listed just above it. The only difference is, that instead of the .atom, it is .html. You can do this through the UI, picking HTML as the input and RSS feed as the output. Or just put the following text

https://granary.io/url?input=html&output=rss&url=
in front of the HTML feed URL.

As long as the reply have very basic microformats, it provides the text. Which is for every webmention I receive that way. I also receive pingbacks in the same way, and there the text is usually missing because of missing microformats (at least I assume this is the reason).

Using this way, the comments do not show automatically in the posts. I know it is possible to include some JavaScript, and the comments would then be generated automatically. I don't do this, since I prefer to do it manually for now. Also, the data is not saved to the website automatically either.

Now, if one is using Wordpress, why not use the Webmention plugin? Honestly, I would suggest for the people to start with that one. And only try to find a different solution, if they have problems with it.

As far as I could see, the plugin does not provide a way to get webmentions by RSS feed. And this is what the question was about, so I did not go that route.