Ik zag (op Twitter, jawel) dat de video van mijn presentatie op WordCamp Netherlands van afgelopen september is gepubliceerd. De video heb ik aan de presentatie toegevoegd, maar zie je ook hieronder.

Op WordCamp NL deed ik een oproep om standaard microformats en webmention in WordPress core, blocks en themes te ondersteunen zodat de 40% van het web die op WordPress draait ineens ook betekenisvol met elkaar kan verbinden: “WordPress sites tot IndieWeb alleskunners maken”.


I hadn’t really looked, but it turns out that Mastodon has incorporated microformats. It has h-feed and h-card, h-entry (a status), and h-cite (a boost). Plaint text properties (p-), e-content, and link properties (u-) are implemented. Indeed, they all surface when looking at a profile’s HTML source. This is what makes it possible to e.g. follow Mastodon feeds as h-feed, next to the existing RSS output and ActivityPub, and that e.g. Brid.gy can do its work to carry over any interaction on a Mastodon post to a blogpost here.

What I haven’t found was what I was looking for.
The ActivityPub protocol in its specs has several so-called Activity Types that drew my attention:

In short ActivityPub supports FourSquare and Dopplr like check-ins and travel plans. I’ve recently added that to my site in terms of microformats and was still wondering how to create a useful stream for it. I’ve been thinking about an OPML outline with schema.org attributes, or a dedicated RSS feed or h-feed. An ActivityPub stream might be of interest too, or even more. There’s a PHP implementation of ActivityPub that includes these Activity Types as well, meaning there’s potential to experiment for me.

I wonder, are there any actual implementations of these ActivityPub types currently?

I am working on following somewhat in Peter’s footsteps. He has his FreshRSS reader connected to his weblog, for everything he ‘stars’ in his feed reader. Those get posted to his ‘favourites’ stream, and send webmentions so they end up as ‘likes’ underneath the original posts. See Peter’s description on his blog.

My plans are a bit more ambitious, an ambition that may yet well bump into the limtis of my php / mysql capabilities.

I want to be able to mark articles in the feed reader for three things: bookmarking, favouriting, and replies. Then I want to add two pieces of content, and post that to my site.

When I favourite something on my blog, I basically always add 2 things when posting it: a rationale for why I like something, and a quote from the original article that meant something to me. See the image below, a screenshot of a ‘favourite’ I marked earlier this month.

That post is made of a short template that I now activate when in my blog’s editor with a hotkey (using AlfredApp) that creates the star, and has a place for the URL, title and author, plus my own motivation for posting, and a quote with the author’s name repeated.
Favourites, bookmarks and replies follow the same template. The only difference is the symbol shown, and the microformat used to signal to the original article what sort of webmention I’m sending their way (so they know how to treat it, e.g. as a like or as a comment/reply)

Peter’s example of favouriting by starring leads to setting a boolean field in the content table itself of the database.
FreshRSS lacks three distinct ‘starring’ buttons, but I can easily add labels to a posting. Those labels are stored in a separate table from the feed articles, unlike when starring.

The first step to take then is to gain access to the postings I mark for follow-up during feed reading. I’ve used the following SQL query:

SELECT ton_entry.link, ton_entry.author, ton_entry.title, ton_entrytag.id_tag, uncompress(ton_entry.content_bin) as content FROM ton_entry JOIN ton_entrytag ON ton_entry.id=ton_entrytag.id_entry

The two key differences with Peter’s SQL statement are, the JOIN part, and the uncompress part. The JOIN statement combines the table that knows what labels I applied with the table that contains all articles, and selects only those where an article ID is in both tables, resulting in a list of the articles I applied labels to. Because in a later step I want to select a quote from the source article the SQL statement also grabs the content of an article. That content is stored as a compressed binary blob (yes, blob is its official name) in the database. Using ‘uncompress’ makes the content blob human readable again, and the ‘as content’ bit puts it in a variable called content.

The next step is allowing me to provide my remarks and select a quote through a form, and the third step to add all that in to the right template based on the label (favourite, bookmark, reply), after which I need to put it into my WordPress install in the right categories and publish it.

As a first step to better understand the different layers of adding microformats to my site (what is currently done by the theme, what by plugins etc.), I decided to start with: what is supposed to go where?

I made a post-it map on my wall to create an overview for myself. The map corresponds to the front page of my blog.

Green is content, pink is h- elements, blue u- elements, and yellow p- elements, with the little square ones covering dt- and rel’s. All this is based on the information provided on the http://microformats.org/wiki/Main_Page, and not on what my site actually does. So next step is a comparison of what I expect to be there from this map, to what is actually there. This map is also a useful step to see how to add microformats to the u-design theme for myself.

Earlier this week I discussed microformats with Elmine. Microformats make your website machine readable, allowing other computers and applications to e.g. find out where my contact information is, and the metadata from my postings.

It was a discussion that branched off a conversation on online representation and marketing. I currently use the Sempress theme on this blog as it does microformats pretty well as far as I can tell, but it doesn’t look all that nice. Previously I had used the microformats plugin in a regular theme, but that didn’t work really well (the plugin is not at fault, it’s a best effort)

Ideally I’d like to add microformats to other sites I use, not just this blog. That means I’d like to add it to a generic theme like U-design. As I think it would be less effort to add microformats to U-design, than make Sempress look better and more generic for my sites. Elmine approached the creators of U-design, but microformats are not on their list of priorities. They do already support schema.org out of the box.

The steps I think I need to make:

  • Map-out visually where I want to use which microformats where and how. [UPDATE: done]
  • Then take a much closer look at the code of the existing Microformats plugin as well as the functions.php file of the Sempress theme
  • to see how the first hooks into existing themes, and how the second shapes the microformats to be added to the html of the page.
  • Determine if one or the other is usable with U-design as is, or alternatively which parts to re-use / adapt

How does this work?

I posted those words just now from my phone using swentel‘s micropublishing app Indigenous for Android. I had tried that before, but I thought it could not use categories. That’s is a key functionality, as I use it to keep postings like these from the front page. This morning I learned during a session on micropublishing that what the micropub client sends is not determining anything on the micropub server side. It just sends the posting and then lets the other end decide what it does with it. I also learned that in microformats categories and tags are the same thing.

It made me realise that where micropub apps talk about categories and tags it doesn’t mean anything about how this WordPress install deals with that. So I tried adding the category name I want in WordPress as a tag to see how this site deals with that. Turns out it works, if you use the internal name of the category in WordPress. So for this posting to end up in the Day to Day category I used the internal name I gave it, which is ‘timeline’, as a tag.