Webmentiond now supports comments

After writing about comments yesterday I’ve now implemented experimental support for comment-type mentions in webmentiond. Using Will Norris’s microformats parser for Go, the current implementation will look for an h-entry at the source-URL of the mention and use its p-name for the title, e-content for the content of the mention, and u-author for its author. All these properties will be stored inside the webmentions table of the database. If the entry has a u-is-reply-to link, then the whole mention will receive the type comment.

At this point, the content is truncated after 500 characters (or actually after 497 in order to always have a maximum of 500 characters) before being stored inside the database.

These new fields are also exposed in the relevant HTTP-API endpoints for each mention. You can see an example for this by looking at the response body of this request:

    "title":"jlelse's Blog",
    "content":"Some people don’t wear their mask over mouth and nose.That’s something I don’t understand at all. If some people wear masks, why don’t they wear them right? I see that sometimes when I go for a walk alone. People pass by me who have a mask over their mouth, but their nose is not covered.In order to generally avoid the narrowness in the supermarket more, I now only go shopping once a week at most and drive to a supermarket that is much bigger and where one can keep more distance than in the supermarket around the corner. Another advantage: The offer is also much better and there are still more of the things I want to buy. (But they didn’t have toilet paper either.)",
    "author_name":"Jan-Lukas Else",

To use this new implementation, simply pull zerok/webmentiond:latest and restart your server 🙂

I’ve also updated the rendering of mentions on my blog, which makes the mention listed above to appear like this:

Rendering of the comment on zerokspot.com with special indicator that it is indeed a comment