There are three generally accepted RSS revisions for creating feeds: RSS
0.91, RSS 0.92 and RSS 2.0. Any recent RSS feed reader should be able to read
all three types properly. There are also several more standards which are
somewhere in-between these three.
RSS 0.91 is the simplest form and the easiest to understand, and not
co-incidentally, is the format we'll be using throughout this article. It
is also the most limited for a number of reasons. RSS 0.91 provides only a
basic set of features, allows a maximum of 15 items in any single feed, limits
the length of the text used in titles and descriptions to 100 and 500 characters
respectively. HTML cannot be used in the descriptions of items in RSS
0.91, as the specification supports plain text only. RSS 0.91 is a very
rigid form, in that each item will have a single link, a title and possibly a
description, with no variations allowed in this pattern.
RSS 0.92 represents an extension of RSS 0.91. It removes a lot of the restrictions
of the previous version and adds support for HTML code to the 'description'
section of items. Items no longer need to have a title or link,
as the description can now be used as both title and link if desired.
The addition of an optional 'enclosure' tag allows an RSS 0.92 feed
to contain files which are downloaded by the user along with the item.
All the length restrictions of the various text fields that were present
in RSS 0.91 are removed in RSS 0.92.
RSS 2.0 is a different branch of the RSS
'tree' than RSS 0.92, though it also originates in RSS 0.91. It supports all of
the additions made by RSS 0.92, and adds a few new wrinkles like support for
secure sites, GUIDs, feed categorizing, etc. A full description can be found here.
Anatomy of a basic RSS 0.91 feed
Now let's take a look at what elements make up a basic RSS feed file.
Here's one we made up especially for the occasion, complete with two items.
Guides: using and creating RSS feeds
weekly newsletter. sign up today!
The <rss version="0.91"> tag at the top identifies the file to readers
as an RSS XML file using RSS version 0.91.
The <channel> section identifies our RSS feed, including a title, a URL
(which is usually pointed at the homepage that hosts the RSS feed), and an
(optional) short description of the feed.
Each <item> section delineates one item or headline that is added to the
feed and will be displayed to users when they download the feed through an RSS
feed reader. Each of these also requires a title and a link (which will
generally go directly to the main page of the information that the item concerns).
A short description (less than 500 characters) can also be added, giving
readers an idea of what the item is about.
After the last item, the </channel>and </rss> tags are closed,
ending the file.
The dashes in between the various tags and items are not necessary, but help
to distinguish them from each other. An empty line works too.
Of course, there are several more things you can do with an RSS feed,
including using different versions of RSS to add HTML support to the item
descriptions, but we'll stick with the basics for now.