UPDATE 2023-03-27: This page is obsolete, as it refers to a prior version of this blog. However, it may be of historical interest.

The “official” atomfeed plugin does not generate valid feeds for the current version (0.3) of the Atom specification because the output does not have a “modified” element for the feed as a whole, just “modified” elements for each story. Obviously the modification date/time for the feed can be interpreted as the date/time modified of the most recent story, so then it’s just a matter of generating the proper output for the MODIFIED tags.

Jason Clark already looked at this and created a patched version of the atomfeed plugin. However his patch requires the use of the lastmodified plugin. While I’m using a rewritten version of the lastmodified plugin, I don’t want to depend on it being present in order to get Atom feeds to work properly.

Prior to discovering Jason Clark’s atomfeed patch I had already patched atomfeed myself. My atomfeed patch has the advantage of not requiring a separate plugin. However the downside is that I had to generate the “modified” element for the feed in the foot section after the “entry” elements for the stories themselves, right before the FEED end tag. Jason’s patch generates the “modified” element for the feed in the head section, which I think is more aesthetically pleasing if nothing else.

Putting the “modified” element for the feed at the end after the “entry” elements doesn’t appear to affect the validity of the feed output; it validates fine according to feedvalidator.org. However I don’t know if this might cause problems for any Atom-aware feed readers out there. (The only ones I’ve tested with are NewsFire and NetNewsWire for OS X; both seem to work fine.)