Martin Atkins (mart) wrote in apparentlymart,
Martin Atkins
mart
apparentlymart

HTML Social Network in Atom

Some time ago I posted about HTML Social Network, which is essentially just a bunch of link "rel" attribute values to indicate relationships between people and social objects.

One limitation of that approach, though, is that it lacks time information. You can't take the link relationships on an arbitrary HTML page and build an ordered list of (for example) status updates without additional context to give you the date and time of publication.

The obvious existing standard for time-based publishing is Atom, but the problem with Atom is that there's no way to know without out-of-band information that Twitter's Atom feeds are of status updates, and Flickr's Atom feeds are of photos, and (although HSN doesn't have a relationship for this right now) Last.fm's feeds are of tracks a user listened to recently. Action Stream services currently have to hard-code various services in order to present results in the correct context.

With this realisation, the obvious answer is to marry the "rel" attribute of HTML with the time-based publishing of Atom. Rather than publishing merely relationships between URLs, let's instead publish relationships between an Atom feed and its constituent entries, which themselves contain URLs. We can infer (using Atom auto-discovery) that a given Atom feed is a stream of information about a given resource. Here's one possible way to encode this:

<feed xml:lang="en-US"
    xmlns="http://www.w3.org/2005/Atom"
    xmlns:ahsn="http://example.com/xmlns/ahsn">
  <title>Twitter / worstusernameevar</title>
  <id>tag:twitter.com,2007:Status</id>
  <link type="text/html" rel="alternate" href="http://twitter.com/worstusernameevar"/>
  <updated>2008-10-13T19:14:32+00:00</updated>
  <subtitle>Twitter updates from Worst Evar / worstusernameevar.</subtitle>
  <entry ahsn:rel="status-update">
      <title>Reading about HSN in Atom.</title>
      <id>tag:twitter.com,2007:[omitted]</id>
      <published>2008-10-13T15:15:54+00:00</published>
      <updated>2008-10-13T15:15:54+00:00</updated>
      <link type="text/html" rel="alternate"
            href="http://twitter.com/.../statuses/957716495"/>
  </entry>
</feed>

Of course, I'm not wedded to this encoding, just the general principle of putting HTML's rel attribute into Atom. I'm open to suggestions of how to do it better. Though I called it AHSN here, really this can be generalized to all values of rel in HTML.

Obviously for backward compatibility for now Action Stream implementations will have to hard-code some assumptions such as "twitter.com feeds have an implied rel of status-update", but hopefully new services can start to include this extra information so that Action Stream services can start to handle these things intelligently without needing to hard-code every possible publishing service.

As usual, I'm open to suggestions about how this idea can be improved.

Subscribe
  • Post a new comment

    Error

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

    When you submit the form an invisible reCAPTCHA check will be performed.
    You must follow the Privacy Policy and Google Terms of use.
  • 3 comments