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:
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.
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:
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:
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?