news feeds

Dominic Mitchell dom at happygiraffe.net
Tue Feb 7 13:12:56 GMT 2006


On Tue, Feb 07, 2006 at 12:26:49PM +0000, Simon Wistow wrote:
> I've added several news feeds to the new London.pm site - an rss, an 
> atom and an iCalendar feed.
> 
> 
> They should be autodiscoverable from any page but you can get them 
> directly from
> 
>     http://london.pm.org/new/london.pm.ics 
>     http://london.pm.org/new/london.pm.rss 
>     http://london.pm.org/new/london.pm.atom
> 
> or you can get the XML file that drives them from
> 
>     http://london.pm.org/new/london.pm.news
>  
> Suggestions for other events appreciated.

Woo!  Thanks you!

> The new site won't go live until the IE rendering bug is fixed. So far
> several people have offered but nobody's actually stepped up yet. 
> Unfortunately, unlike every other time this has happened I won't be able
> to fix it because 
> 
> a) I'm an HTML retard 
> and 
> b) I don't have IE.
> 
> Secondly, Feedvalidator.org says that the Atom feed is all kinds of
> wrong but XML::Atom seems to be the only Atom generating module on CPAN. 
> Suggestions gratefully accepted.

Doing work with XML::Atom is possible, but hard due to the poor
documentation.  I would suggest:

1.  Use the latest version (just in case you're not already).

2.  Explicitly passing in "Version => 1.0" whenever you create a new
XML::Atom object.  Otherwise you get weird mixed namespaces.  Either
that, or Atom 0.3, which is deprecated.

> Thirdly, Feedvalidator also says (perhaps spuriously) that the HTTP
> header should have the character encoding in it. There appears to be no
> way to turn this off in CGI.pm. Again, suggestions welcome although I'm 
> not too worried about this one.

The way to fix this is to serve the RSS feed with a type of
'application/rss+xml' type ('application/atom+xml' for Atom).  CGI.pm
will only set the charset if the media type is text/*.

Sending out XML as text/* is frowned upon.  This is because proxies are
allowed to recode it into different character sets.  Which could break
the XML because they wouldn't know to update the <?xml version="1.0"
charset="iso-8859-9" ?> header as well.  So use application/* instead.

-Dom


More information about the london.pm mailing list