Home >
Quick Reference
How to Create an RSS Feed Last updated:
July 18, 2008
What Is RSS?
RSS is the
acronym used to describe the de facto standard for the syndication of
Web content. RSS is an
XML-based format,
and while it can be used in different ways for content distribution, its
most widespread use is in distributing news on the Web.
A Web site that wants to
allow other sites to publish some of its content can create an RSS
document (also called an RSS feed) and register the document with an RSS
publisher. Syndicated content can include data such as
news, events listings, news stories, headlines, project updates,
excerpts from discussion forums or even corporate information.
Because there are different versions of RSS, the term RSS is most
frequently used as a name to mean the syndication of Web content, rather
than as an acronym for its founding technology. When using the name RSS
the speaker may be referring to any of the following versions of Web
content syndication:
-
RDF Site Summary (RSS
0.9, RSS 1.0)
-
Rich Site Summary (RSS
0.91, RSS 1.0)
-
Really Simple
Syndication (RSS 2.0)
When using the term RSS,
most will use it in reference to Rich Site Summary or the previous
version called RDF Site Summary. When referring to Really Simple
Syndication, it will usually be called RSS 2.0, not RSS. There are
several versions of RSS available, with the most commonly implemented
version being RSS 0.91. The most current version, however, is RSS 2.0
and it is backward-compatible with RSS 0.91. It's important to remember
that RSS is an XML (Extensible Markup Language ) based format and that
all RSS feeds must conform to XML v1 standards.
RECOMMENDED
READING: For those
interested in learning more about XML, we recommend reading "A
Technical Introduction to XML" on XML.com
How To Create An RSS Feed
When a Web site publishes an RSS
document, the feed will usually contain a summary of the most recent
articles and content published on the site. Most feeds will offer
readers a headline plus a brief headline description (or summary), along
with a description of the source Web site. RSS feeds are created by
using tags that are enclosed in brackets, much like HTML code is. For
those interested in creating their own RSS feed, all you need to start
is a text editor (like Notepad). All you really need to know, at the very
minimum, are the tags you must include to make the RSS feed work.
Here we will show you the
basic steps to creating an RSS feed, using Webopedia's most recently
published articles as our feed headlines. The example uses only the basic tags
required to make it work. The first three tags you will need to know how
to use are the title,
description, and
link tags.
title:
The title or headline
EXAMPLE: <title>All About RSS</title>
link: The URL of the Web
page where the content (or news story) is located.
EXAMPLE: <link>http://www.webopedia.com</link>
description: A sentence that describes the
content.
EXAMPLE: <description>How to create
simple RSS Feeds</description>
This code as typed into your text editor
would look like this:
<title>All
About RSS</title> <link>http://www.webopedia.com</link> <description>How to create simple RSS Feeds</description>
|
These three tags, when combined are
called an item. After you
have specified the details for each of the three required tags, you then
wrap the <item> tag around it, like
this:
<item> <title>How to Create an RSS Feed</title> <link>http://www.webopedia.com/quick_ref/RSS.asp</link> <description>How to create simple RSS Feeds</description>
</item>
|
If you have several items
(headlines) for your feed, you use the same three required tags with each
wrapped in its own
<item>
tag. For example, we'll use the last four articles published on
Webopedia as our items:
<item>
<title>How To Create an RSS Feed</title>
<link>http://www.webopedia.com/quick_ref/RSS.asp</link>
<description>How to create an RSS Feed.</description>
</item>
<item>
<title>Instant Messaging Abbreviations</title>
<link>http://www.webopedia.com/quick_ref/textmessageabbreviations.asp</link>
<description>This guide will help you decipher chat and instant
messaging lingo.</description>
</item>
<item>
<title>Tips
for Using Fonts</title>
<link>http://www.webopedia.com/DidYouKnow/Hardware_Software/2008/fonts.asp</link>
<description>Fonts
are the core of your site design, so using them wisely is critical.
We show you how with tips and tricks for creative results.</description>
</item>
<item>
<title>DVD Formats Explained</title>
<link>http://www.webopedia.com/DidYouKnow/Hardware_Software/2007/DVDFormatsExplained.asp</link>
<description>The following sheds light on DVD's different flavors
and the incompatibility issues that the differing technologies have
sprouted.</description>
</item>
|
Now, that we showed you the tags and the
information you need to produce items (the title, description, and URL
link) for your RSS feed. Another important aspect of RSS feeds is making
sure you identify the feed source (called a channel), which is
usually your Web site that publishes the content. This is done using
the same three required tags, as above, but you simply omit the item tag.
When you leave out the item tag feed readers are able to distinguish between your channel information and
your item information. For a Webopedia feed we might use something like
this:
<title>Webopedia
Headline Articles</title> <link>http://www.webopedia.com/</link>
<description>Webopedia's knowledge sections offer information on
common Internet and computer technologies and
occurrences.</description>
|
You will also need to specify the
channel using tags that are inserted at the beginning
and end of your document.
<channel></channel>. Everything we have done so far is
going to be placed between the open and closed channel tags, like this:
<channel>
<title>Webopedia
Headline Articles</title>
<link>http://www.webopedia.com/</link>
<description>Webopedia's knowledge sections offer information on
common Internet and computer technologies and
occurrences.</description>
<item>
<title>How To Create an RSS Feed</title>
<link>http://www.webopedia.com/quick_ref/RSS.asp</link>
<description>How to create an RSS Feed.</description>
</item>
<item>
<title>Instant Messaging Abbreviations</title>
<link>http://www.webopedia.com/quick_ref/textmessageabbreviations.asp</link>
<description>This guide will help you decipher chat and instant
messaging lingo.</description>
</item>
<item>
<title>Tips
for Using Fonts</title>
<link>http://www.webopedia.com/DidYouKnow/Hardware_Software/2008/fonts.asp</link>
<description>Fonts
are the core of your site design, so using them wisely is critical.
We show you how with tips and tricks for creative results.</description>
</item>
<item>
<title>DVD Formats Explained</title>
<link>http://www.webopedia.com/DidYouKnow/Hardware_Software/2007/DVDFormatsExplained.asp</link>
<description>The following sheds light on DVD's different flavors
and the incompatibility issues that the differing technologies have
sprouted.</description>
</item>
</channel>
|
Now, at this point we are almost done
creating this RSS feed, and so far the process has been relatively easy.
We have specified the items and channel for an RSS feed. In
finishing up, much like in any HTML or XML file, we also have to specify
the document type. In an RSS feed you need to show that the feed meets
XML both RSS specifications. Now this particular feed does meet XML
1.0 and RSS 2.0 specifications. We will show this in the code with the
following tags:
<?xml
version="1.0"?>
<rss version="2.0"></rss>
The
<?xml version="1.0"?>
does not require a close tag, and it will
also be the very first line in your RSS document. The RSS version tag,
however, does require a close tag and it needs to be wrapped around
everything in your <channel> tag, like
this:
<?xml
version="1.0"?> <rss version="2.0">
<channel>
<title>Webopedia
Headline Articles</title> <link>http://www.webopedia.com/</link>
<description>Webopedia's knowledge articles offer information on
common Internet and computer technologies and
occurrences.</description>
<item> <title>How To Create an RSS Feed</title> <link>http://www.webopedia.com/quick_ref/RSS.asp</link> <description>How to create an RSS Feed.</description> </item>
<item> <title>Instant Messaging Abbreviations</title> <link>http://www.webopedia.com/quick_ref/textmessageabbreviations.asp</link> <description>This guide will help you decipher chat and instant
messaging lingo.</description> </item>
<item> <title>Tips
for Using Fonts</title>
<link>http://www.webopedia.com/DidYouKnow/Hardware_Software/2008/fonts.asp</link>
<description>Fonts
are the core of your site design, so using them wisely is critical.
We show you how with tips and tricks for creative results.</description>
</item>
<item> <title>DVD Formats Explained</title> <link>http://www.webopedia.com/DidYouKnow/Hardware_Software/2007/DVDFormatsExplained.asp</link> <description>The following sheds light on DVD's different flavors
and the incompatibility issues that the differing technologies have
sprouted.</description> </item>
</channel> </rss>
|
RECOMMENDED READING:
The
RSS Specifications Web site will provide you with details on the
different specifications and what is required to meet them.
Saving and Validating Your Feed
Now that you have a basic RSS feed typed up in Notepad or another text editor, you need to save the file. Since RSS is an XML-based format
we're simply going to make up a file name and give it an XML extension.
We'll call ours webofeed.xml. If you
have a browser that supports Feeds, you can
view our example feed here.
After the file has been saved, the next
step is to validate your feed. A Feed Validator is used
to basically check your code for errors. If the validator finds any
problems with your feed, it will highlight where the problem occurs to
help you fix it. To use a Feed Validator you must upload your RSS feed
to a Web server, then enter the URL into the Feed Validator.
Two of the more popular online Feed
Validators are FEED Validator
and RSS Validator.
Continue on to
page 2 for non-required (optional)
channel and item tags,
more on RSS specifications, and a look at feed syndication and
aggregators.
By Vangie Beal
Last updated: July 17, 2008
|