Today is the first installment of the Windows RSS “Publisher’s Guide.” Over the development of the RSS features in Windows Vista, we’ll post regular features on what RSS feed publishers need to do to properly integrate with IE. In general, these will be simply be to do what most people in the community already expect (this post is a great example of that), so there will be few surprises. However, we think that being explicit about exactly what we support never hurt anyone. This way, the community can tell us if we’re doing something wrong, or we can explain why we chose one particular direction over another. Hopefully, this particular topic won’t be controversial.

The most up-to-date version of the “Publisher’s Guide” will always be available at this link: http://blogs.msdn.com/rssteam/articles/PublishersGuide.aspx. Each time we add something to it, we’ll post to the blog as well. Once we ship, we’ll mirror the guide on MSDN.


RSS autodiscovery

The “Web Feeds” button in IE 7 for Windows XP and in Windows Vista is designed to “light up” when the web page the user is viewing has an associated web feed.

Overview

In order to tell IE (and other browsers, for that matter), that your page has an associated web feed, you need to add a link element inside the header of your web page.

<html>
  <head>
    <link rel="alternate" type="application/rss+xml" title="your feed title here" href="http://www.company.com/feedurl.rss">
  </head>
<body>
...

Put the title of your feed in the title attribute and the URL to the feed itself in the href attribute. And, you’re done.

Now, when a user goes to your web page, the “Web Feeds” button will light up (and if the user chooses, a sound can play). When the user clicks on the button, it will display the title that you put in the link element, and clicking on the title will navigate the user to preview the feed itself (which IE will render in a readable form in the browser - from there the user will be able to subscribe to your feed).

Multiple feeds

As it happens, you can have as many of the <link> elements in your web page and IE 7 Beta 1 will show the titles of all of them in a list, in the order you put them in the page. The user can pick any of them to navigate to that feed.

Here’s an example of the button in IE 7 Beta 1 lighting up on the MSNBC site:

Best Practices

The following is a collection of best practices (do’s and don’ts) for how to leverage RSS autodiscovery in your web pages.

DO choose good titles

As you can see in the example above, IE will display the title as you write it in your page. Therefore, it’s a good idea to actually put the title of the feed right there. A few sites (like this one!) have “RSS” as their title.

DON’T list the same feed in different formats

Unless you have a really good reason, it’s not a good idea to have two links (or three!) that provide the same feed in different formats. It just makes the user have to pick between two things that they are not capable of distinguishing between. Pick your favorite format, and just support that.

DO put your most relevant feed first

You are always welcome to put as many feeds as you want in your header, but you should make sure that the one at the top is the one that’s most relevant to the page itself. In future updates to IE 7, we will be making changes to optimize for the most common scenario of having a single feed. Getting to that first (or only) feed in the list will be one-click away. Getting to the others will be one or two more clicks.

DO continue providing links to your feed(s) in your web page

There’s no harm in continuing to provide ordinary to your feeds in the web page. In many cases, you can provide a more descriptive text than you can fit in the link element. Whether the user clicks on the Web Feeds button or the user clicks on one of those links, IE will recognize that’s it is a feed and display it properly. Additionally, in some cases -- for example, sites with lots of feeds -- it’s probably best to simply provide links to those in a list on the page instead of putting two dozen feeds in the header.

References

Mark Pilgrim's post on RSS autodiscovery: http://diveintomark.org/archives/2002/06/02/important_change_to_the_link_tag

Note: In future releases of IE 7, we'll support Atom autodiscovery as well. When we do, we will update this publisher's guide.

Hope this was helpful!

- Sean