Adding webmentions to my website
After thinking about it a long time, I have replaced the comments section on this website with Webmentions.
This page was published on
.
Tags:
I stopped accepting comments in favour of Webmentions a while back. This was not a decision we made lightly, especially because I put a lot of time and energy in adding comment support recently.
Why remove comments?
While I was able to fully moderate the comments and reduced the spams to near zero, I also need to be aware of the privacy concerns of the people commenting on my website.
I tackled this by letting people comment anonymously, but I still allow them to share their name, email, etc., if they like.
There are some problems with this approach:
- Validity:
- I have no way to ensure that the person commenting on my website is really the person whom they are claiming to be.
- Spams and trolls:
- While I have managed to prevent all automated spams, people can manually troll my website, adding a gate like moderation to block this behaviour helps, but is still not good for my mental health.
- Interactivity:
- People usually comment and expect a response, but my previous system was treating it like shouting at the void, so it's not a good user experience.
- Visibility:
- If someone comments or mentions my website on their website, that is also a comment, there is no way for me to track it unless they enter their whole comment again on my website.
Why Webmention?
Some of you already know this, I partially support IndieWeb on this website. One of the major things that I was missing for in it was Webmentions. Unlike supporting comments, Webmentions makes it easy to filter out things that I don't want and works as a better gatekeeper than manual moderation (though I still moderate the Webmentions I receive).
Webmention is a W3 standard to let websites talk to each other, it could be a comment, like, a simple reference, or whatever. The idea is that, if Website A
has a link that mentions Website B
, the Website A
or someone else can tell Website B
about that link being referred to and by whom.
This makes comments straightforward to manage, while also keeping the web do it's original purpose of connecting to each other.
Implementing Webmention
Implementing the Webmention is simple, I initially used the code for adding comments, and also automatically verified the link, which would've made my website part of a DDoS network. So I decided to remove the link verification part on a later commit. I also removed the comments in that same commit after thinking about the problems I described in the previous section.
This means that my current implementation for receiving Webmention is as simple as validating the URL format and storing it in a database. I have a dedicated admin page for manually verifying it and adding it to my posts. I have a script that extracts the mention from the links I save, but I have not opened it up for the public yet (it will be done in a few weeks, so stay tuned).
What next?
I have not implemented sending Webmention from my website, I just use a cURL
command for it currently, as it is just sending a POST
request with the source and target links.
# curl command to send webmention
curl -si protocol://the-website.tld/webmention-endpoint \
-d source=protocol://my-website.tld/my-mention \
-d target=protocol://the-website.tld/the-page-being-mentioned
Ideally, I would have a way to crawl through my pages, extract all external links I have in it, and send a Webmention to them if I have not done that already. It's a lot of work, and I want to integrate it to my Webmention verification script so that it can be used by everyone. I am a bit preoccupied to do that at the moment.
Supporting IndieAuth is the next one on my list, I already have a way to log in to this website with a password, IndieAuth would be a wrapper around it to redirect to a URL and generate a token. If I don't end up redesigning this website, IndieAuth would be the thing you will see in my next blog post.