IndieWeb: fragment subscriptions to microformats

IndieWeb: fragment subscriptions to microformats

In the past couple weeks, the IndieWeb crowd got a lot of attention. This is a very good news, because we strongly believe the web needs more diversity and the indieweb movement is clearly a step in that direction.

Yet, the current POSSE culture, as well as a strong biais against RSS/Atom feeds means that this community currently relies on silos for the it’s following features. Pragmatically, most of the actors there provide RSS or Atom feeds, though, but they seem to put more effort into crafting their microformated HTML.

That’s not a problem, because Superfeedr obviously can deal with that very well too, thanks to our fragment subscriptions, and here this is a perfect example to illustrate how it works. We’re basically re-using the # element of topic URLs to indicate which part of an HTML page you’re subscribing to.

Let’s pick Barnaby’s blog. His site has a nice layout and a lot of interesting navigation items, but what I’m really interested in knowing is actually the entries (h-entry in h-feed speak) he publishes. So, rather than subscribing to the whole HTML document (Superfeedr would allow that), I will subscribe to the entries using this topic URL: http://waterpigs.co.uk/notes/#.h-entry (basically, the fragment is the CSS path of the content to which I want to subscribe on the page).

For the sake of this example, I have indeed subscribed to Barnaby’s site and used a Runscope capture to log the requests. It’s as easy as this:

curl -X POST -ujulien:paSsWOrD https://push.superfeedr.com -d'hub.mode=subscribe' -d'hub.callback=https://n6ygb81xcek3.runscope.net' -d'hub.topic=http://waterpigs.co.uk/notes/#.h-entry' 

Here’s an example of a notification (click on View Request ) that was sent to the webhook.

 

As you can see the notification includes the HTML content that has an h-entry class. Of course, I could have used a more complex CSS expression if I wanted a more specific item.

For this, and because Barnaby’s blog is not (yet?) PubSubHubbub enabled, you’ll need a Superfeedr subscriber account, but next, we’ll show you how you can also enable PubSubHubbub on your IndieWeb site so that anyone can subscribe to your microformatted content in your indieReader (as well as your RSS/Atom feeds) :)

Liked this post? to get more or read the archive.

Comments