RSS and ATOM

Web feeds let publishers syndicate frequently updated content automatically, such as blog entries, news headlines, audio, and video.

Subscribers to a website's RSS no longer need to manually check the site for new content. Instead, a feed reader program constantly monitors the feed, notifies the subscriber of updates, and downloads new data as needed.

A software program called an "aggregator" or "feed reader" - web-based, desktop-based, or mobile-device-based - presents feed data to subscribers, who can receive timely updates from multiple favorite websites in one place.

RSS

RSS (Rich Site Summary), often dubbed Really Simple Syndication, has become popular due to early feed reader support. A minimal RSS 2.0 feed is shown in the example below.


Atom

Atom is technically more advanced than RSS. It has less restrictive licensing, an IANA-registered MIME type, an XML namespace, URI support, and Relax NG schema support. An example Atom 1.0 feed is shown below.


RSS to Atom Element Mapping

RSS 2.0Atom 1.0
authorauthor*
categorycategory
channelfeed
copyrightrights
descriptionsubtitle
description*summary, content
generatorgenerator
guidid*
imagelogo
itementry
lastBuildDateupdated*
link*link*
managingEditorauthor or contributor
pubDatepublished
title*title*
ttl--

* indicates that an element must be provided, except for the Atom elements "author" and "link", which are required only under certain conditions.


ch11-rss-feed.xml:
<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
<channel>
   <title>RSS Title</title>
   <description>This is an example of an RSS feed</description>
   <link>http://www.example.com/main.html</link>
   <lastBuildDate>Mon, 06 Sep 2010 00:01:00 +0000</lastBuildDate>
   <pubDate>Sun, 06 Sep 2009 16:20:00 +0000</pubDate>
   <ttl>1800</ttl>

   <item>
      <title>Example entry</title>
      <description>Here is some text containing an interesting description. </description>
      <link>http://www.example.com/blog/post/1</link>
      <guid>7bd204c6-1655-4c27-aeee-53f933c5395f</guid>
      <pubDate>Sun, 06 Sep 2009 16:20:00 +0000</pubDate>
   </item>
</channel>
</rss>

ch11-atom-feed.xml:
<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
   <title>Example Feed</title>
   <subtitle>A subtitle.</subtitle>
   <link href="http://example.org/feed/" rel="self" />
   <link href="http://example.org/" />
   <id>urn:uuid:60a76c80-d399-11d9-b91C-0003939e0af6</id>
   <updated>2003-12-13T18:30:02Z</updated>

   <entry>
      <title>Atom-Powered Robots Run Amok</title>
      <link href="http://example.org/2003/12/13/atom03" />
      <link rel="alternate" type="text/html"
              href="http://example.org/2003/12/13/atom03.html"/>
      <link rel="edit"
              href="http://example.org/2003/12/13/atom03/edit"/>
      <id>urn:uuid:1225c695-cfb8-4ebb-aaaa-80da344efa6a</id>
      <updated>2003-12-13T18:30:02Z</updated>
      <summary>Some text.</summary>
      <content type="xhtml">
         <div xmlns="http://www.w3.org/1999/xhtml">
            <p>This is the entry content.</p>
         </div>
      </content>
      <author>
         <name>John Doe</name>
         <email>johndoe@example.com</email>
      </author>
   </entry>
</feed>