[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

friendlier feeds



I've been playing with making feeds friendlier, using content
negotiation.

For example:
  http://www.mnot.net/bookmarks/feed

If you request it with a browser, you'll get an HTML page, telling
you how to use RSS; if you request it with an aggregator, you'll get
the RSS. This is because your browser sends an Accept: header
containing 'text/html'. 

In Apache, I do this with this directive in access.conf:

  <LocationMatch "/feed$">
  Options +MultiViews
  </LocationMatch>

Then, whenever I publish a feed, I put in two files; feed.rss and
feed.html.

I haven't tested this with any aggregator except my own; if anyone
has a problem, please tell me.

The (slight) downside of this is that if your browser knows how to
read RSS (or dispatch it to another program that does), it has to do
one of two things;
  a) know to put 'application/rss+xml' in the Accept header, with a
     higher q value than 'text/html' (or just omit the Accept header)
  b) pass the URI to the helper app, which makes the request
     itself

I think this is manageable.  

-- 
Mark Nottingham
http://www.mnot.net/