XMPP, Publish-Subscribe, PEP and User Tune

[Starting this again, now I understand better how it works and have actually updated Psi to a version that receives User Tune notifications...]

BBC Radio Labs has a new prototype which broadcasts metadata for tracks played on the radio over XMPP.

If it was using standard Publish-Subscribe (PubSub) nodes (i.e. if it was broadcasting generic events), it would look like this:

2008-02-14-Pubsub

But it's actually using the User Tune protocol, which is based on PEP, a special case of PubSub where each user automatically becomes a PubSub node, and all the clients in their roster ("buddies") are automatically subscribed to their notifications:


2008-02-19-Pubsub


Clients (such as a "Now Playing" page) subscribe to a specific user - radio1, for example - by adding them to their roster and being authorised to receive presence notifications; whenever that user's status changes the message gets broadcast to all the subscribers.

Here's an example message:

<message from="radio1@hug.hellomatty.com" to="alf@hug.hellomatty.com/Psi">
  <event xmlns="http://jabber.org/protocol/pubsub#event">
    <items node="http://jabber.org/protocol/tune">
      <item id="1203447868">
        <tune xmlns="http://jabber.org/protocol/tune">
          <artist>Panic! At The Disco</artist>
          <title>Nine In The Afternoon</title>
        </tune>
      </item>
    </items>
  </event>
</message>

Comments

Do you know of any standalone pubsub client implementations (i.e. something other than "the Psi codebase") ?

I think Ralphm said he'd knock me up some demos for Wokkel, but I haven't got around to looking (the site seems to be down right now).

I haven't actually tried to do real pubsub yet, but I _imagine_ it's easy enough to create the subscription XML packet and handle the responses with something like xmpppy or xmpp4moz.

Yeah, for simple stuff you can construct it yourself. It would just be nice if there was an API so that you could do everything else in the spec :)

(Idavoll uses Wokkel underneath: see http://wokkel.ik.nu/ or some test code here: http://wokkel.ik.nu/browser/trunk/wokkel/test/test_pubsub.py)

All fields are optional, email address will not be shown; no HTML, URLs are automatically hyperlinked.