I've been using Firefox extensively for a few months now, and loving it. But there's been one thing I've struggled with: Live Bookmarks.
Live Bookmarks are a very cool concept -- basically, it's a very user friendly way of displaying RSS ("Really Simple Syndication") feeds within your Web browser. When you subscribe to an RSS feed (or Atom, another tool for syndicating content on the Web) via Live Bookmarks, it appears in your Bookmarks folder (the equivalent of "Favorites" in Internet Explorer). So do all of the headlines associated with that site.
My problem? I couldn't get it to work with Nuketown's RSS feed. Even when I had the RSS feed linked to directly from the home page, that little orange "subscribe" icon (it looks like a series of radio waves, kind of like a wi-fi icon turned on its side) wouldn't appear.
I wasn't sure what the problem was, but I had a theory. Unlike many blogs, I generate my own RSS feed using a PHP script that queries Nuketown's MySQL database. Although my XML was properly coded according to the RSS spec, the file didn't have the proper media type set for the http header.
Feedvalidator.org had told me this on several occasions (complaining that "Feeds should not be served with the 'text/plain' media type") but since getting the proper type set involved screwing around with the server, I ignored it.
Well, the time had come to stop ignoring it. If Firefox couldn't read my feed because of this, then it was a sure bet that other programs couldn't handle it.
Changing the Media Type of an RSS Feed
I did a little surfing on Google, and came across an article entitled "Publishing Through A RSS Feed - Quick Guide" by Elixir Systems. Most of it was old hat, but one section in particular drew my eye: "RSS Validation" which talked about how to deal with the error Feed Validator had spit out at me. The key for Apache users like me was to create an htaccess file that specifically told the server how to deal with XML/RSS media types (also called "MIME" types). The lines in question (taken from this post; I claim no originality here -- I'm including it here for completeness' sake.) were as follows:
addtype application/rdf+xml rdf
addtype application/rss+xml rss
addtype application/atom+xml atom
addtype application/xml xml
I immediately tried this out, sticking the htaccess file in the root of my site folder (not the www folder; the actual "root" that's above the www folder). And I got the exact same error as before.
Frustrated, but not beaten, I did a little more searching regarding htaccess files and turned up this entry with in the Apache documentation. Reading it, I discovered that in order to work properly, you need to include the same file in every folder between the folder that contains the file you want to control (in my case /home/www/rss) and the root folder. So I stuck a copy of the htaccess file in my root folder, my www folder for the site, and the rss folder within www.
And everything worked! FeedValidator gave me its first unqualified blessing of my feed, and I danced a little jig ... which promptly ended when I tried to get Firefox to recognize the feed, and it failed.
Firefox, Live Bookmarks and Head Tags
I continued my search and found an article at builder.com that talked about setting the document type using the hyperlink to the RSS feed. Brilliant I thought, this should work. But, of course, it didn't.
So I decided to find a site that worked and see how they did it. I surfed on over to GeekNewsCentral.com, which is a site I spend a fair amount of time visiting and/or listening to (Editor Todd Cochrane's got a podcast). I pulled up their site and took a peek at their code ... and that's when I saw it -- this slender line of code within the "head" portion of Todd's XHTML:
<link rel="alternate" type="application/atom+xml" href="http://www.geeknewscentral.com/atom.xml"/>
And that sparked a memory of the previous code I'd seen within the builder.com story. It turns out that this bit of code is what Firefox is looking for. It tells Firefox about an alternate source of data for the web site (or at least, that's what I think it does) and it works just as well for RSS as it does for Atom.
Here's what my code ended up looking like for Nuketown's home page:
<link rel="alternate" type="application/rss+xml" href="/rss/index.xml" title="Nuketown RSS news feed"/>
That's all it takes. Firefox will now "live bookmark" my feed, and I'm hoping these changes will better aid the various blog-centric search engines as they attempt to index both the site and the feed.

