Simon Fell > Its just code > Subscriber Interface for

Tuesday, February 12, 2002

As a fully fledged adict, i find the hourly update in Radio to be too long a wait, so i constantly have open, and keep hitting refresh, looking for blogs that i follow.

So, to help build a better tool for this, i started by building a subscriber interface to the data. You register the URL(s) of the weblogs you want to subscribe to, and the port & path of where your callback handler is [it must be at the same address as the subscribe call]. Then when the service sees a change in any of the URL's you subscribed to, it'll call you back with a SOAP message saying its updated.

This is just the ground work, more interesting scenarios can be built on top of this. Radio would be an obvious client, as it already has something to manage a list of favorites, just need some code to subscribe to all your favourites, and a callback listener that tracks the callsbacks, and displays them somewhere obvious.

There's also scope for a small stand alone app that does something similar.

In addition other notification layers can be built on top, such as IM messages, .NET Alerts, email, SMS etc.

The WSDL that describes the subscription interface is here. Here's a sample subscribe request generated by PocketSOAP

Content-Type: text/xml; charset=UTF-8
User-Agent: pocketSOAP/1.3.beta.2
Accept-Charset: UTF-8, UTF-16
Content-Length: 701
SOAPAction: ""

<S:Body><a:Subscribe><urls XI:type='Enc:Array' Enc:arrayType='XS:anyType[2]'><i XI:type='XS:string'></i>
<i XI:type='XS:string'></i>
<callback_port XI:type='XS:int'>80</callback_port>
<callback_path XI:type='XS:string'>/dummy.asp</callback_path>

When the service sees a change in a weblog you are subscribed to, it'll call you back with a message like

  <sp:Body xmlns:xsd=""
    <m:updated xmlns:m="">
      <weblogs enc:arrayType="m:weblog[1]"
        <weblog xsi:type="m:weblog">
          <url xsi:type="xsd:anyURI"></url>
          <name xsi:type="xsd:string">its just code</name>
          <timestamp xsi:type="xsd:dateTime">2002-02-15T07:29:26Z</timestamp>

Subscriptions are valid for 48 hours, you need to call subscribe again before the 48 hours expires to renew the subscription.

Changes are polled from, so there can be upto a 5 minute delay before you'll get a notification callback