Archive for the 'Blogging' Category

Note: I've reorganized this site to use tags; the category archive remains to support old links. Only posts prior to April, 2006 are categorized. Tag Archive »

Feed Autodiscovery Redux

I [recently added][1] the needed markup to enable Feed Autodiscovery on my site. This is the mechanism that powers Firefox’s [Live Bookmarks][2] feature, and allows sofware such as an aggregator to automatically find your feed. At the time, I made the following observation:

For now, every page contains an autodiscovery link for the main RSS feed. However, Blosxom provides RSS feeds for all categories as well (RSS is just another flavour to Blosxom). I could have category indexes provide autodiscovery links to category RSS feeds, but I doubt this is what most users would want.

I’ve never made any attempt to directly publish per-category feeds, although a user in the know could get them due to the nature of Blosxom. RSS is just another flavour as far as Blosxom is concerned. To get a feed for the category X/Y/Z, just pull example.com/weblog/X/Y/X/index.rss and you’re done. By default, your category feed’s title, link, and category will be the same as your main feed. There are many ways to address this with Blosxom; but I was always more concerned with how to offer them. I didn’t really want an orange XML icon next to each category, and a feeds page seems excessive. Autodiscovery makes it easy to only offer the feed that applies to the category being viewed, but it doesn’t make sense to replace your standard feed.

A few days later, I was reading Ben Goodger’s [Inside Firefox][3]. I read [a post about Live Bookmarks][6] in which Ben wrote (emphasis added):

…hope more sites will start using the <link> tag – sites that do, please give your feeds meaningful title attributes! I hate seeing “Subscribe to ‘RSS'” in the popup menu!

This got me thinking, and a couple of days later, I went back and re-read Mark Pilgrim’s [Important change to the link tag][4] article from a couple of years ago, which solidified the autodiscovery mechanism. In it was this bit:

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.

Mark doesn’t seem to be doing this anymore, but I’ve since seen sites using multiple links to offer multiple formats. I’m using it now to offer category-specific feeds from the category indexes (and from permalinks), alongside the regular feeds. If you’re using Firefox, click a category link on the right and then click the XML statusbar icon to see it in action. The relevant part of the <head> looks like this if you view source:

<link rel="alternate" type="application/rss+xml" 
      title="jclark.org - All Posts (RSS)" 
      href="http://jclark.org/weblog/index.rss" />

<link rel="alternate" type="application/rss+xml" 
      title="jclark.org - All Posts in WebDev/Blogging (RSS) "
      href="http://jclark.org/weblog/WebDev/Blogging/index.rss" />

I accomplished this in my head.html flavour file using my [updated storystate plugin][5] along with interpolate_fancy. The relevant bit:

<link rel="alternate" type="application/rss+xml" 
      title="jclark.org - All Posts (RSS)" 
      href="http://jclark.org/weblog/index.rss" />

<?$storystate::category>
    <link rel="alternate" type="application/rss+xml" 
          title="jclark.org - All Posts in WebDev/Blogging (RSS) " 
          href="http://jclark.org/weblog/WebDev/Blogging/index.rss" />
</?>

<?$storystate::permalink>
    <link rel="alternate" type="application/rss+xml" 
          title="jclark.org - All Posts in WebDev/Blogging (RSS) " 
          href="http://jclark.org/weblog/WebDev/Blogging/index.rss" />
</?>

The only thing left was to fix my head.rss to accomodate category feeds intellegently:

<?$storystate::blogroot>
    <title>jclark.org</title>
    <link>http://jclark.org/weblog</link>
    <description>the weblog at jclark.org - All Posts

Feed Autodiscovery

Among the new features in Firefox 1.0 Preview Release is Live Bookmarks, which lets you view an RSS or Atom feed as a bookmark folder. Firefox takes advantage of RSS Autodiscovery to determine the availability of a feed for your page. Implementing autodiscovery is a cinch, just add an extra <link> to you page’s head. For an RSS feed:

<link rel="alternate" type="application/rss+xml" title="RSS"
      href="http://www.example.com/yourrssfilename.xml" >

And for an Atom feed:

<link rel="alternate" type="application/atom+xml" title="Atom"
      href="http://www.example.com/youratomfilename.xml" >

When a feed is present, a little orange XML icon will appear in your status bar; clicking the icon allows you to add a Live Bookmark. Personally, I’d rather be able to use it to add a Bloglines subscription, more on that in a moment.

The presence of the XML icon on the status bar can be instructive. For example, while viewing the Newest Firefox Extentions page on Mozilla Update, the XML icon appeared. Searching the page, I could find no link to the feed. This feed seems to be autodiscoverable only. By using view source, I was finally able to subscribe to feed (see blogroll for link, category Techish).

The absence of the XML icon can also be instructive. Turns out I never added an autodiscovery link to my site. Shame on me. I’ve added the link, if you’re using Firefox 1.0PR (or newer), you should see the XML icon in your status bar. For now, every page contains an autodiscovery link for the main RSS feed. However, Blosxom provides RSS feeds for all categories as well (RSS is just another flavour to Blosxom). I could have category indexes provide autodiscovery links to category RSS feeds, but I doubt this is what most users would want.

Nice as the feature is, Live Bookmarks are no replacement for a good aggregator – Bloglines is my pick. I had given some thought to developing an extention to change the behavior of the icon (I’ve been meaning to learn how to write extentions for a while), but now I don’t have to. Michael Koziarski has released version 0.7 of Feed Your Reader, a Firefox extension. Originally designed to support desktop aggregators using the feed:// scheme, the new version adds support for many web-based aggregators, including Bloglines. I’ve downloaded it but not yet restarted Firefox, so I haven’t given it a try, but I will soon. More later.

Think Before You Speak

Sam Ruby is conducting a test to see how people feel about being required to preview their blog comments prior to posting them. Since Sam’s test system seems to be only allowing preview, and not post, I’ll comment here.

I prefer to see my comments in preview before I post… I am a notoriously poor typist, and often think faster than I type. I usually end up tweaking posts on my blog two or three times immediately after posting, because I’ve never gotten around to adding preview to my web-based posting system.

Am I less likely to be spontaneous? I doubt it. I didn’t have to take time out to register; I can start typing as soon as I read your post (or another comment). The only difference is, I’m asked to read my own work before others do. This might make me reconsider something I typed, but probably only if it was prone to moderation anyway. Will it help with comment spam? Can’t hurt.

Great Minds….

Lars is creating his blogroll by converting OPML to HTML via XSLT. I’ve been meaning to get my blogroll up on my site for a while now. I use NetNewsWire as my aggregator, which can export OPML. I toyed with the idea of writing a python script to parse it up, simply because I’ve been reading up on python and I need an excuse to write some python code.

But OPML is XML, and XSLT is designed for converting XML formats, and I do a lot of work with XSLT at work. I was giving some thought just a few days ago to using XSLT to convert it. I think that’s the way I’ll go at this point.

I do want to do some special processing, but I should be able to do it all via XSLT. For one thing, I sometimes subscribe to comments feeds on things I’ve commented on. I see no need to show these in a blogroll. As long as NNW‘s OPML exports the groups I’ve put my feeds into, it should be pretty straightforward.

No More Excuses

As I’ve mentioned previously, I’ve become spoiled by the ubiquity of RSS Feeds. And now, there’s no more excuses not to have a feed. The fine folks at Feedster are now offering Feedster Builder, a service that will create a RSS feed for your site automatically. All you have to do is add a few tags to your blog templates. What could be simpler? It will help keep your bandwith down too, since Feedster will be hosting the actual feed.