Quick intro on Simple List Extensions

Microsoft is on the RSS train and has adopted the syndication format. Internet Explorer 7.0 will have support for RSS, for example by allowing you to use it as a some form of RSS aggregator.



As a part of their adoption on RSS, Microsoft has again used his “embrace and extend” strategy and added Simple List Extensions (SLE) to RSS. Although the specification of RSS does not state this explicitly, RSS can be used as a list of all sorts of items, not just weblog entries. E.g., Ebay uses RSS to allow you to keep track of a search of items on auction. This link takes you to a list of all Bandai solar powered handheld games currently available. SLE expands on the idea of lists and adds extra information to the RSS feed that will allow sorting and grouping of the list.


SLE is reasonably easy to implement. The SLE specification at the MSDN website is self-explanatory. To give you an idea of what it is like, check out a short sample of SLE enhanced feed:



<rss version=2.0 xmlns:trackback=http://madskills.com/public/xml/rss/module/trackback/ xmlns:wfw=http://wellformedweb.org/CommentAPI/ xmlns:slash=http://purl.org/rss/1.0/modules/slash/ xmlns:cf=http://www.microsoft.com/schemas/rss/core/2005 xmlns:kb=urn:www-killerapps-nl:killerblog:syndication xmlns:pingback=http://madskills.com/public/xml/rss/module/pingback/>


  <channel>


    <cf:treatAs>list</cf:treatAs>


    <title>Alex Thissen Weblog Build 1.15.10.1971</title>


    <link>http://www.alexthissen.nl/weblog</link>


      <cf:listinfo>


        <cf:sort ns=http://purl.org/rss/1.0/modules/slash/ element=comments data-type=number label=Responses default=true />


        <cf:sort ns=“” element=pubDate data-type=date label=Date default=false />


        <cf:sort ns=“” element=title data-type=text label=Title default=false />


      </cf:listinfo>


The bold items are part of SLE. Notice the new namespace with the cf prefix. The <cf:treatas> element indicates that the RSS feed should be treated as a list. The order of the items is significant and should be respected by aggregators. It also means that items that disappear from the feed should be removed from the list.


The <cf:listinfo>element is the container for <cf:sort> and <cf:group> elements. The sort element signals a child-element (by the element and ns attributes) in the set of <item> elements (these represent the items in the feed, like weblog entries or ebay auctions) that will be used to sort on. The sorting will depend on the data type. The one sort element that is marked as default=”true” will be used by default. Last of all, the label attribute will be displayed in IE in the list of sortable properties of the feed. All pretty straightforward so far.


Grouping is similar to sorting, but lacks the data-type and default attributes. Check out the post on SLE from the RSS teams blog for more information. The Links category is interesting to read.


Internet Explorer will provide sorting on date and title of items by default, when no <cf:listinfo> is specified. Once <cf:listinfo> is included, they will disappear and a List Order will be added. In the example above I have included these date and title defaults again (pretty handy) and also added a sorting on the number of comments from the <slash:comments> element. This is where the real power of SLE comes in: you can enrich the RSS feed with your own meta-data and sort or filter on that data by using SLE.


Let’s say that you add additional information to the item like so:



<item>


  <kb:views>103<kb:views>


  <title>Quick intro on Simple List Extensions</title>


where kb is the namespace like introduced earlier and the number indicates the number of views of this particular item. By adding a that looks like this:



<cf:sort ns=urn:www-killerapps-nl:killerblog:syndication element=views data-type=number label=Popularity default=true />


you should be able to sort on the number of views of a RSS item.


Have you got any ideas for cool meta-data that can be added to a weblog RSS feed, or items for a RSS feed in general?

Advertisements
This entry was posted in Uncategorized. Bookmark the permalink.

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 )

Google photo

You are commenting using your Google 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 )

Connecting to %s