Atom 1.0 Feeds in WordPress

After a small amount of hacking, I now have fully-valid Atom 1.1 feeds for entries (thanks to comatoast’s patch, although I patched it further because the <id>s were silly) and comments (thanks to this Atom 0.3 comments feed thing). They’re both valid: entries, comments.

Here are the relevant files I now have in my 1.5.2 installation:

There is also an RSS entries feed for legacy software.

Tip for those using the Universal Feed Parser: there’s a patch for Atom 1.0 support (that’s how I got Straw to be happy).

Heh heh heh. Atom 1.1 exists only in my imagination. Did I mention I implemented the <unicorn> element in my feed?

6 Responses to “Atom 1.0 Feeds in WordPress”

  1. James Snell Says:

    There is no Atom 1.1. The IETF draft defines Atom 1.0

  2. Holizz Says:

    Heh heh, silly me.

    Thank you. I would have gone on confused for ages if you hadn’t pointed it out and prompted me to check the document.

  3. Kurt McKee Says:

    Were there any big changes to bring the comments feed in line with the Atom 1.0 spec? Also, is there anything you would recommend adding or changing? Thanks for linking me!

  4. Holizz Says:

    No big changes. It was mostly some name changes like modified/updated, and adding an id for the feed. I chose /comments/ as the feed id even though it doesn’t exist by default because I couldn’t bring myself to call it /comments/feed/ and it couldn’t have been / since the entries feed would have that as its id.

    That’s about it.

    By the way, thank you for providing the Atom 0.3 comments feed source, I didn’t relish the thought of writing it from scratch (not least because I’m not famaliar with WordPress and its functions).

  5. Kurt McKee Says:

    I’ve submitted the script to the Wordpress bug tracker. The only change I made to the script was to add a check to ensure the IS a subtitle before outputting the tags (otherwise it won’t validate against feedvalidator.org’s validator if there is no subtitle). Other than that I left the script intact because (a) it validates, and (b) the subject lines are consistent with those in the RSS feed generator.

    http://trac.wordpress.org/ticket/1785

  6. Holizz Says:

    That’s a good idea. I never thought of contributing my code back to WordPress. Thanks for taking the time to do so.

Leave a Reply

You must be logged in to post a comment.