AutoDiscovery of RSS feeds

As taken from DiveIntoMark.org. This is my copy just I don't loose it.

All you early adopters, pay attention. The LINK tag for pointing to a page’s RSS feed is changing (just once, and then solidifying forever). Both the type and title attributes are changing to be more specific. The new syntax is this:

<link rel="alternate" type="application/rss+xml" title="RSS" href="url/to/rss/file">

If you installed the Radio auto-subscribe bookmarklet or the Amphetadesk auto-subscribe bookmarklet, please visit those links and install the new version.

If you updated your template over the weekend to include the old LINK tag, please update it once more to include the new one. (Kudos to Simon Fell for implementing this within minutes of this announcement.)

This change comes in response to (valid) criticism that the old way was too general, and could cause confusion if, in the future, there were other XML-based formats that pages wanted to link to. Using a more specific MIME type (the exact type was suggested by Dan Brickley) solves this potential problem, and the more specific title goes along with it.

Current implementations:

  1. Radio: Dave Winer has agreed to support this change in Radio. All Radio users should be sure to read this and update their templates accordingly. It buys you more than just the new LINK tag; read Dave’s tutorial for details.
  2. Manila: Manila generates the new LINK tag automatically on all Manila-hosted weblogs, assuming you haven’t removed the {meta} macro from your template.
  3. Aggie: Aggie RC3 is a newsreader for .NET that supports RSS auto-discovery and has lots of other new features.

Implementation notes (for those writing tools that look for the LINK tag):

  1. The combination of rel="alternate" and type="application/rss+xml" defines this as a link to an RSS file.
  2. The title is not relevant to you; it is exposed in the user interface in some browsers, but it should not be used to identify the link tag.
  3. The URL given in the HREF does not have to be fully qualified. href="/index.xml" is a valid construction. This is consistent with other HTML constructs.
  4. Attributes may appear in any order. This is consistent with other HTML constructs.
  5. Attributes may be quoted with double quotes, or quoted with single quotes, or unquoted. This is consistent with other HTML constructs.
  6. A single page may define more than one RSS LINK tag, if the page has more than one associated RSS feed. This is consistent with other LINK constructs (for example, stylesheets pointed to by LINK tags). You are under no obligation to support more than one, but if you don’t, it’s your loss.
  7. On an XHTML page, the final bracket will have a space and a forward slash before it. Don’t let this confuse you. Example:

    <link rel="alternate" type="application/rss+xml" title="RSS" href="http://diveintomark.org/xml/rss.xml" />

Tips for site authors:

  1. The title does not have to be “RSS", but keep in mind that some browsers (iCab, Mozilla, Lynx) will expose the title to the end user, so it should be descriptive.
  2. If you have multiple RSS feeds, define one LINK tag for each of them. (I’m doing this now for my category-specific feeds; view-source on diveintomark.org for an example.) Presumably next-generation news aggregators (and the way things have been going, we’re talking maybe by Friday here) will display a list of all available feeds and let the user choose one or more. Give each LINK tag a different title, so users know what they’re selecting.
  3. LINK tags go in the HEAD, not the BODY.

Thank you to everyone who has been working on making this come together in the past few days. It has been surprisingly painless and friction-free. Together, we have come up with a new standard that is useful, elegant, forward-thinking, and widely implemented. In 4 days.

Add comment

  Country flag


  • Comment
  • Preview
Loading