I'm Brett Slatkin and this is where I write about programming and related topics. You can contact me here or view my projects.

15 November 2010

PubSubHubbub for arbitrary content

Not to be outdone by Superfeedr's launch of JSON PubSubHubbub support, I have now pushed what we're calling "arbitrary content" support in the PubSubHubbub reference codebase and server.

What does that mean? Any web resource that is self-describing can now be pushed via PubSubHubbub using the demo hub. For example, if you publish an ActivityStreams JSON resource you can now make it real-time with PubSubHubbub.

We've been working towards this for a while. Monica fleshed out most of the proposal, with helpful contributions from Martin. The "turduckin" problem still exists for resource types that rely on headers for correctness, but luckily the most useful formats thus far (RSS, Atom, ActivityStreams JSON, hAtom) are self-describing, so this is not a show-stopper. The next step is to codify this behavior (and Superfeedr's functionality) into a spec that builds on the PubSubHubbub core.

Some other fun side-effects:
  • The reference hub will pass through non-RSS/Atom content without any modification, including data like JPEGs and binary content
  • People who have subscribed to an HTML resource will now get an HTML payload delivered to them; that means people like Tantek who want to use hAtom in their HTML can make their hAtom real-time
  • Feeds with charsets like EUR-JP will now get pushed to subscribers, though the hub codebase makes no attempt to do feed-entry diffing, since it cannot parse the XML
  • Facebook's real-time API is one step closer to being another implementor of the PubSubHubbub spec
Try it out and let us know how it goes!
© 2009-2024 Brett Slatkin