Get your feed in

Some of my friends always ask for RSS feeds from the web site www.developeriq.com. I often tell them that since we have only a couple of updates in a month (often less than 10), I have not bothered to put one up. However, there are other reasons! The web site has evolved over five years, from a simple HTML template web site to a more complicated data driven web site with multitudes of include files and some scripts, which have never been updated. However, it still works most of the time and the CMS system written by us ensures that a story can move from the writer’s desktop to the web site in less than 40 seconds.

Since, like everyone else, we also wanted to move to the much-hyped Web 2.0 standards, it meant that we needed to have a feed on the web site. One of the problems is that most automatic feed generators such as feedburner.com refused to parser through the DeveloperIQ.com web site because of many deprecated tags and not well-formed XHTML specifications. Others found it very difficult to parse through include files and identify the right feeds.

As I write these words, we are in the process of writing our own feed creators for DeveloperIQ web site.

Enough of that story! Any publisher, blogger or web master intent on increasing the number of viewers, and of course revenues, cannot ignore feeds. It is simple and a real world implementation of how syndication works. 

How does syndication work?

If you check your daily newspaper you may notice in the byline (where the author name is credited) of certain stories, names such as Associated Press, Reuters, PTI and others. These are news production companies who work on a business model, where other media companies can subscribe to their services on a syndication model. You will hence see the same story appearing across multiple newspapers and magazines, all attributed to the same source.

A feed works in the same format, in fact much better. For example, an RSS/XML feed can have the latest headlines from your favorite news site downloaded on to your desktop without you ever visiting the web site. Similarly, from your web site you can drive traffic by sending your feeds to hundreds and thousands of users.

However, the politics seen in the past two years in the technology space has meant that the world of XML feeds is a bit more complicated that what you think it is. For example, there are seven different standards on RSS-XML. And RSS finds tough competition from Atom, an alternate XML technology that is slightly different. 

If you have visited rediff.com, you will see a choice of JavaScript-based feeds too. Choice galore! However, the publishers as well as users are suffering from issues associated with incompatibilities resulting from the presence of multiple standards.

The politics behind
In an earlier article, November 2004 issue, I had introduced RSS to you. RSS has many abbreviations. One of them is Really Simple Syndication. Historically, RSS was an idea that Netscape introduced and the first standard was RSS 0.90. Netscape tried and failed with many technologies after losing out in the nineties browser wars with Microsoft; RSS 9.0 was one of them. Then a company called UserLand came and reworked on the standard and released 0.91, 0.92, 0.93 and 0.94.

Suddenly RSS was in vogue and different vendors tried taking advantage of the technology. However, one of the problems was the presence of too many standards and too many people trying to standardize RSS.

There was an RSS DEV group set up, which introduced an XML Namespace-based RDF standard. While from a developer’s point of view a namespace-based standard makes it easier to modularize an XML file, it looked terse to an average parser and trying to parse different standards was a pain.

This resulted in RSS 2.0, which again UserLand was instrumental in bringing out, and was ratified, among others, by the Harvard University, which has copyrighted it. Somehow the world has been saner and RSS 2.0 has made obsolete most of the 0.9x standards, though work on RSS 1.0 is still on.

Microsoft has long been a supporter of RSS and is one of the key players behind the technology. Companies such as Microsoft, UserLand, etc. have been trying to figure out ways to make the best use of RSS in areas outside content syndication.

Technology world is always bipolar. In the case of RSS, an alternate technology that is suggested and is being championed, notably by Google, is Atom. Atom being a newer standard has certainly ironed out some of the issues with RSS. However, it is still lagging behind RSS in terms of popularity.

In this article we will take a look at how Atom and RSS address syndication issues. If someone raises a question “which feed should I have on my web site”, the answer is simple. Have both and if possible more! XML feeds will be a very influential factor in the forthcoming days.

The Players

Microsoft and UserLand back RSS. These companies are looking at extending RSS into other applications. Microsoft has already succeeded in managing their user groups through RSS. There are several organizations that are running communities, supporting customers and sending newsletters through RSS. It is expected that the W3 Consortium will ratify RSS. RDF has already been ratified.

Atom is a standard that has evolved over the past few years. It is the resultant of improvements made over a few APIs of blogging web sites like Livejournal, Blogger and MetaWebLog. The first Atom standard was 0.30, which was subsequently deprecated by most parsers. The current version is 1.0 and is slowly being standardized. The Internet Engineering Task Force has ratified the Atom 1.0 specification. This technology has found acceptance among many IT giants, notably Sun Microsystems and IBM.

However, since the acquisition of Blogger by Google, Google has standardized on the Atom 1.0 standard. This has also meant a ‘Microsoft vs. Google’ war in the XML feed space.

What does an RSS feed consist of?

Essentially, an RSS feed is an XML document that is well formed and needs to have a title, description and link. It can then have items, which can be empty. The keyword channel identifies the start of an XML feed.

Here is an example of the DeveloperIQ XML Feed. I have included just one feed for the sake of brevity. Refer code 1.

Code 1

<?xml version="1.0" ?>
<rss version="2.0">
<channel>
<title>
Developer IQ 
</title>
<description>
An allround Developer Magazine based out of Bangalore India 
</description>
<link>
http://www.developeriq.com 
</link>
<item>
<title>
Accenture in a SAPed drive 
</title>
<description>
One out of six employees will be a SAP pro. Netweaver is the technology to bet on 
</description>
<link>
http://www.developeriq.com/articles/view_article.php?id=514
</link>
</item>
</channel>
</rss>


An RSS feed snippet of www.developeriq.com


If you take a careful look at the code snippet that represents the RSS feed of DeveloperIQ web site, you will see that the structure is very simple. The first element of the XML file is rss, which includes the element channel. The first node under channel will give you the details of the feed. This is followed by individual items, which can contain any of the 30 tags (some of these are listed in Table 1).

What does an Atom feed consist of?
Atom feed looks a bit more cryptic, thanks to the use some of the namespaces. The first element of an Atom feed is feed. Atom 1.0 provides “author” and “contributor” elements at both the feed and entry level. These elements must contain a name and also have an optional email and URI sub-elements. Atom 1.0 requires that both feeds and entries include a title (which may be empty), a unique identifier and a last-updated timestamp.

Here is an example (code 2) of an atom feed for www.developeriq.com.

Code 2

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

<title>Developer IQ</title>
<subtitle>Asia’s No 1 developer web site</subtitle>
<link href="http://developeriq.com"/>
<updated>2005-10-10 T19:32:02Z</updated>
<author>
<name>Ramdas S</name>
<email>ramdas@developeriq.com</email>
</author>
<id>urn:uuid:60a78bc0-d399-11d8-b93C-0003939e0af6</id>

<entry>
<title>XML and Data Islands</title>
<link href="http://www.developeriq.com/articles/view_article.php?id=517”
<id>urn:uuid:1225c695-cfb8-4ebb-aaaa-80da344efa6a</id>
<updated>2005-9-10T18:30:02Z</updated>
<summary> XML is a great technology.</summary>
</entry>

</feed>

Table 1: Element Comparison Table (Source: Tim Bray)

RSS 2.0

Atom 1.0

Comments

Rss

-

rss tag is required for RSS.

Channel

feed

Channel is the next level element for rss, while feed is the first level element for Atom feeds.

Title

title

 

Link

link

Atom defines an extensible family of "rel" values.

description

subtitle

The tag description is used to provide a summary in RSS.

language

-

Atom uses standard “xml:lang" attribute.

copyright

rights

 

webMaster

-

 

managingEditor

author or contributor

 

pubDate

published (in entry)

Atom has no feed-level equivalent.

lastBuildDate (in channel)

updated

RSS has no item-level equivalent.

Category

category

 

generator

generator

 

Docs

-

 

Cloud

-

 

Ttl

-

 

Image

logo

Atom recommends 2:1 aspect ratio.

-

icon

As in “favicon.ico".

Rating

-

 

textInput

-

 

skipHours

-

 

skipDays

-

 

Item

entry

 

Author

author

 

-

contributor

 

description

summary and/or content

Depending on whether full content is provided.

comments

-

 

enclosure

-

<link rel="enclosure"> in Atom.

Guid

id

 

Source

-

<link rel="via"> in Atom.

-

source

Container for feed-level metadata to support aggregation.


Popularity

RSS feeds are definitely more popular, when compared to Atom. However, Atom has certain advantages over RSS 2.0. One of them is that the Atom API is much easier to program. The second advantage is that unlike RSS you do not worry about multiple versions.

Ideally, you must have both RSS and Atom feeds on your site. The web site www.feedburner.com lets you convert an Atom feed to RSS. Similarly, you can use feedparser.org for a free service to parse your Atom and RSS feeds for validity.

End Note

It is apparently clear that if your web site has to be called a Web 2.0 standard, you need to have a feed on your web site. It is advisable to have both RSS and Atom feeds.




Added on January 7, 2007 Comment

Comments

Post a comment

Your name:

Comment: