Atom Support Patch
The Atom support patch implements support for the ATOM syndication format in Sparkle.
Why ATOM Appcasts?
First, because of the Atom syndication format itself - a better RSS. ATOM is a standardized feed format (RFC 4287), the result of a consensus work of the Atompub Working group in the IETF. It clears many ambiguities existing in the RSS specification. For instance, the entry can be plain text, escaped HTML, well-formed XHTML, XML content or a pointer to external web content not present in the feed itself, and the content format is explicitly labeled to avoid misinterpretation of the content and help validation. The specification also includes a standard schema for validation. The ID, dates, summary and contents, also have a clear specification.
The ATOM working group also proposed several extensions in addition to the syndication format, for instance feed history, and a publication specification to update an ATOM feed through a REST API. In a nutshell: ATOM is a strong foundation for a feed format, allows for clean extensions and has very interesting stuff happening in this space (especially in the API domain: the Google APIs for Picasa web, blogger, calendar, etc are based on ATOM).
ATOM and RSS Appcasts Compared
ATOM and RSS structure are very similary: "channel" is a "feed", "item" is an "entry", and the
Here is the RSS example from the Sparkle documentation.
<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:sparkle="http://
www.andymatuschak.org/xml-namespaces/sparkle">
<channel>
<title>Some App Changelog</title>
<link>http://mysite.org/appcast.xml</link>
<description>Most recent changes with links to updates.</description>
<language>en</language>
<item>
<title>Version 2.0 (2 bugs fixed; 3 new features)</title>
<description>http://mysite.org/noteson2.0.html</description>
<pubDate>Wed, 09 Jan 2006 19:20:11 +0000</pubDate>
<enclosure url="http://mysite.org/files/myapp_2.0.zip" length="1600000"
type="application/octet-stream"/>
</item>
</channel>
</rss>
The ATOM version would be:
<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
<title>Some App Changelog</title>
<subtitle>Most recent changes with links to updates.</subtitle>
<link href="http://mysite.org/appcast.xml" rel="self"/>
<id>http://mysite.org/appcast.xml</id>
<updated>2007-07-26T18:33:30Z</updated>
<author><name>The author</name></author>
<entry xml:lang="en">
<title>Version 2.0 (2 bugs fixed; 3 new features)</title>
<updated>2006-01-29T19:20:11Z</updated>
<link href="http://mysite.org/files/myapp_2.0.zip" length="25201727" rel="enclosure" type="application/octet-stream"/>
<id>http://mysite.org/noteson2.0.html</id>
<summary type="html">Releases notes available on <a href="http://mysite.org/noteson2.0.html">the web</a></summary>
<content type="text/html" src="http://mysite.org/noteson2.0.html"/>
</entry>
</feed>
Interesting differences between the RSS and ATOM versions:
- The feed should have author information (email or website can also be provided in this section)
- The feed and each entry must have an unique id. An URL or an uuid (in the form <id>urn:uuid:38d4fae0-8e88-11db-b606-0800200c9a66</id>) can be used.
- Referencing content not in the feed but available on the web is allowed by the spec (the <content type="text/html" src="..."> tag), but inline content is also possible, in that case, a summary tag should be provided for fallback if the content is not available or not supported by the client
- The link element references the feed itself. You could add another link element with rel="alternate" to include a link to the HTML version (see next example)
- The enclosure information linking to the application version is also expressed through a link tag, with a rel="enclosure"
- Dates are expressed in RFC format
- Language can be specified through the standard xml:lang attribute for an element and its descendants.
Another ATOM Appcast Example
- An additional link element points to the application web page
- In this examples, UUID are used for feed and entry identification
- Additional author contact information
- The enclosure tag includes additional data (version info) in the sparkle namespace
- The entry has the release notes inline, without reference to an external URL, thus no summary is needed in this case.
- A link tag in the entry points to a HTML version
<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns:sparkle="http://www.andymatuschak.org/xml-namespaces/sparkle" xmlns="http://www.w3.org/2005/Atom">
<title>TestApp AppCast</title>
<link href="http://example.com/testapp/appcast.atom" rel="self"/>
<link href="http://example.com/testapp" rel="alternate" type="text/html"/>
<id>urn:uuid:38d4fae0-8e88-11db-b606-0800200c9a66</id>
<updated>2007-07-26T18:33:30Z</updated>
<author>
<name>John Doe</name>
<uri>http://example.org/johndoe</uri>
<email>johndoe@example.com</email>
</author>
<entry>
<title>TestApp 1.1 available</title>
<updated>2007-07-26T18:33:30Z</updated>
<link href="http://example.com/testapp/testapp_1.1.3879.zip" title="TestApp 1.1 (r3879)" rel="enclosure" type="application/octet-stream" length="25201727" sparkle:version="3879" sparkle:shortVersionString="1.1"/>
<id>http://example.com/testapp/version-45</id>
<link href="http://example.com/testapp/version-3879.html" rel="alternate"/>
<content type="html">A minor release with 2 performance fixes <i>Intel only</i></content>
</entry>
</feed>
The Patch Itself
I tried to keep the simple and straight-to-the-point implementation in the RSS class (i.e. don't expect a full Atom feed processor).This patch basically replace the RDF /non RDF boolean marker with a RDF/RSS/Atom enum and handle the Atom elements and properties by using the keys used in the RSS case, so the rest of the code is left intact.
If you find issues in the Sparkle ATOM support patch, please e-mail me (Olivier Gutknecht - olivierg @ gmail.com) and I'll update it.