Home

RSS is a standard format for data/news exchange over the Internet. However, it is based on polling rather than pushing. Every few hours or minutes, your RSS reader needs to “ask” the data source if there is new data available. This causes unnecessary traffic and delays for your news to pop-up in your RSS reader.

If you use a desktop RSS reader that instantly refreshes your feeds everytime you hit the “Refresh” button, you’ll still get the most recent news, which is fair enough. However, if you use an online reader such as Google Reader, Pulse or Flipboard, manually refreshing your feeds does not necessarily mean the reader refreshes the feed from the actual source, but rather from its cache. With such readers, your feed is only as up to date as the online reader updates its cache. In the case of Google reader this can be up to a few hours or more.

PubSubHubbub is a recent protocol that enables RSS readers to update feeds in realtime. It uses an agent (called hub) as a mediator between the publisher and its subscribers. Everytime the publisher publishes a new post, it sends a notification to its hub, which broadcasts a notification to all subscribers that there is a new post available. RSS readers that support PubSubHubbub (Google Reader and Flipboard being two of those) can received such update notifications and automatically refresh the feed when there is a new post. Hence, the reader appears to be updated in real-time.

If you run a blog such as WordPress, there are plugins (PubSubHubbub, PuSHPress) that automatically make your feeds PubSubHubbub compatible. However, I worked on a custom project where I needed to achieve this manually. FeedBurner promises to make your feeds PubSubHubbub-able but it does that by periodically checking your feeds for updates, so that’s a bottleneck by itself.

Even though PubSubHubbub seems to be such an innovative and important new concept to the web, there is very few good tutorials how to upgrade your feeds manually if you’re a publisher. I found this one the best resource out there so far: https://www.linux.com/learn/tutorials/382878:weekend-project-add-pubsubhubbub-syndication-to-your-site-or-blog

Basically, there are 3 steps involved to make your feed PubSubHubbub compatible:

  1. In your RSS/Atom feed, include a link to a hub of your choice, e.g. <link rel=”hub” href=”http://pubsubhubbub.appspot.com&#8221; />. PubSubHubbub is an open protocol, so you can run a hub on your own server or use a service that provides a Hub for you. The link above references a hub google set up for testing purposes.
  2. Notify your hub that your feed uses it as a hub (after step 1), or that you published a new post in your feed (everytime after you publish a new post). With the google hub, this can be done manually (go to https://pubsubhubbub.appspot.com/publish, enter the URL of your feed and click Publish) or automatically through a script (there are libraries for different languages available at http://code.google.com/p/pubsubhubbub/wiki/PublisherClients). Your code would trigger this script everytime you publish a new post.
  3. RSS reader subscribes to your feed. If it supports PubSubHubbub it will recognise the <link rel=”hub”…/> link in your feed, and subscribes to that hub to receive updates when new content is available.

I did all of the steps above and Google Reader still wouldn’t update the feed after there is a new post. According to the PubSubHubbub specification the hub double-checks if the content has changed before he notifies the subscribers. I played around with the format of my feeds, and it turns out that one way of highlighting to the hub that the feed actually contains new content is to add a unique identifier to the each post that you publish, i.e. add an <id></id> element to each <entry></entry> element in your feed. Find my example atom feed below (id-elements highlighted). After I added unique ids to my posts, the hub would recognise new posts, and they would almost immediately pop-up in Google Reader.

<?xml version="1.0" encoding="UTF-8"?>
 <feed
 xmlns="http://www.w3.org/2005/Atom"
 xmlns:thr="http://purl.org/syndication/thread/1.0"
 xml:lang="en-US"
 xml:base="http://theedge.checkinsystem.net/wp-atom.php">
 <title type="text">Gelatine @The Edge » Projects</title>
 <subtitle type="text">who is here and does what?</subtitle>
 <updated>2012-11-07T12:44:32Z</updated>
 <link rel="alternate" type="text/html" href="http://theedge.checkinsystem.net" />
 <id>http://theedge.checkinsystem.net/feed/atom/</id>
 <link rel="self" type="application/atom+xml" href="http://theedge.checkinsystem.net/API/feed/spec.xml" />
 <link rel="hub" href="http://pubsubhubbub.appspot.com" />

<entry>
 <author>
 <name>Example Author</name>
 </author>
 <title type="html"><![CDATA[project 3]]></title>
 <link rel="alternate" type="text/html" href="http://theedge.checkinsystem.net/project-13/" />
 <id>http://theedge.checkinsystem.net/project-3/</id>
 <updated>2012-11-07T12:44:32Z</updated>
 <published>2012-11-07T12:44:32Z</published>
 <category scheme="http://theedge.checkinsystem.net" term="Future Project Ideas" /> <summary type="html"><![CDATA[asfd asdf asdf adfs asdf Project Collaborators : asdf]]></summary>
 <content type="html" xml:base="http://theedge.checkinsystem.net/project-13/"><![CDATA[<p>asfd asdf asdf adfs asdf</p>
<ul class="wpuf_customs"><li><label>Project Collaborators</label> : asdf</li><ul>]]></content>
 <link rel="replies" type="text/html" href="http://theedge.checkinsystem.net/project-13/#comments" thr:count="0"/>
 <link rel="replies" type="application/atom+xml" href="http://theedge.checkinsystem.net/project-13/feed/atom/" thr:count="0"/>
 <thr:total>0</thr:total>
 </entry>
 <entry>
 <author>
 <name>Example Author</name>
 </author>
 <title type="html"><![CDATA[project 2]]></title>
 <link rel="alternate" type="text/html" href="http://theedge.checkinsystem.net/project-13/" />
 <id>http://theedge.checkinsystem.net/project-2/</id>
 <updated>2012-11-07T12:44:32Z</updated>
 <published>2012-11-07T12:44:32Z</published>
 <category scheme="http://theedge.checkinsystem.net" term="Future Project Ideas" /> <summary type="html"><![CDATA[asfd asdf asdf adfs asdf Project Collaborators : asdf]]></summary>
 <content type="html" xml:base="http://theedge.checkinsystem.net/project-13/"><![CDATA[<p>asfd asdf asdf adfs asdf</p>
<ul class="wpuf_customs"><li><label>Project Collaborators</label> : asdf</li><ul>]]></content>
 <link rel="replies" type="text/html" href="http://theedge.checkinsystem.net/project-13/#comments" thr:count="0"/>
 <link rel="replies" type="application/atom+xml" href="http://theedge.checkinsystem.net/project-13/feed/atom/" thr:count="0"/>
 <thr:total>0</thr:total>
 </entry>
 <entry>
 <author>
 <name>Example Author</name>
 </author>
 <title type="html"><![CDATA[Project 1]]></title>
 <link rel="alternate" type="text/html" href="http://theedge.checkinsystem.net/project-13/" />
 <id>http://theedge.checkinsystem.net/project-1/</id>
 <updated>2012-11-07T12:44:32Z</updated>
 <published>2012-11-07T12:44:32Z</published>
 <category scheme="http://theedge.checkinsystem.net" term="Future Project Ideas" /> <summary type="html"><![CDATA[asfd asdf asdf adfs asdf Project Collaborators : asdf]]></summary>
 <content type="html" xml:base="http://theedge.checkinsystem.net/project-13/"><![CDATA[<p>asfd asdf asdf adfs asdf</p>
<ul class="wpuf_customs"><li><label>Project Collaborators</label> : example</li><ul>]]></content>
 <link rel="replies" type="text/html" href="http://theedge.checkinsystem.net/project-13/#comments" thr:count="0"/>
 <link rel="replies" type="application/atom+xml" href="http://theedge.checkinsystem.net/project-13/feed/atom/" thr:count="0"/>
 <thr:total>0</thr:total>
 </entry>
</feed>

Useful links:

Advertisements

2 thoughts on “How to Manually set up PubSubHubbub for your RSS/Atom Feeds

  1. This is a very good tip particularly to those fresh to the blogosphere.
    Simple but very precise information… Appreciate your
    sharing this one. A must read post!

    Like

  2. Pingback: Gelatine – Designing for Digital Encounters in Coworking Spaces | kavasmlikon

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s