6. To err is human... to blame your computer for your mistakes is even more human, it is downright natural. - Murphy's Laws of Computing

Writing An Atom Feed

Sunday 23rd October 2005

Categories: Guides, Internet, Code

Introduction

To those of you wondering what Atom is, it is essentially an alternative to RSS. Hang on, you might say, then why should I bother learning Atom? Personally, I prefer using Atom over RSS since it is controlled by a standards body, whereas RSS... isn't. Unfortunately, RSS still has greater compatibility than Atom, hence the two feeds available on this site.

In particular, this article is looking at Atom 1.0, which is the latest version of Atom. Fortunately, Atom's history is rather simpler than that of RSS, with just an uncomplicated line of Atom 0.3 and Atom 1.0.

Largely because this page needs a bit more padding out, here's a sample feed:

<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">

<title>Example Feed</title>
<updated>2005-10-22T21:05:58Z</updated>
<id>tag:http://www.example.com,2005:1</id>

<entry>
<title>Atom-Powered Robots Run Amok</title>
<id>urn:uuid:1225c695-cfb8-4ebb-aaaa-80da344efa6a</id>
<updated>2003-12-13T18:30:02Z</updated>
</entry>

</feed>