Unlike most Belisarius posts, this one is technical documentation (sorry). It tells you how to create an RSS feed, that is, how to syndicate your web site. If you have no interest in such subjects, please come back to Belisarius for the next post, when things will return to normal. Or subscribe to the RSS feed, and you’ll be notified of updates.
This post allows me to bait traffic with some popular keywords. But no
kidding, it’s extremely simple to syndicate your site. If you
can add a link to your website, and look at (not necessarily
understand) an XML file without getting queasy, you’ve got it
made.
People disagree
about what RSS stands for,
but they agree that it’s a method of syndicating your website.
It works the same way regardless of how you expand the acronym.
Website syndication operates on the publish-and-subscribe model. The
website publishes a description of new material; subscribers receive
the description as a notification that the site has been updated.
Subscribers need a news
aggregator, of which there are many to choose.
One way to think of an RSS feed is this: potential subscribers have
TVs that can be hooked into many cable systems at once. Each RSS feed
is a single cable, which can carry multiple channels, like a TV cable.
For example, an RSS channel could be devoted to a single writer or
topic. Your RSS feed can provide subscribers with complete material or
summaries of it, accompanied by links to your site.
Creating an RSS feed is easier than you might think:
That’s all I had to do. The last two steps are optional. You
normally only need to validate (Step 4) when you make structural
changes. If you omit the announcement (Step 5), readers can subscribe
to your site directly through your link (Step 3).
Thus, a private feed’s cycle might be simply:
A public feed might also alert external update monitors that the site
has changed.
Many cases are more complex than mine, with more frequent updates,
more authors, multiple channels, and so on. The more complex cases
simply expand on and automate this basic formula.
Basically, an RSS feed is a file that subscribers can check. If you
update this file, subscribers are notified by their news aggregators
that your site has new content.
The site description file is an XML (eXtensible Markup Language) file.
If you’re not familiar with markup languages, don’t be
intimidated; all you’re doing is filling in a form.
The site description file publishes information about your newest
articles. You decide what “new” means: what to say about
the new articles; what the title text should be; what URL each item
links to; and so on. Depending on the RSS version you declare, you
might be able to specify author names and other information for each
item.
A site description file includes:
Channels and items are enclosed in special tags. They each have three
basic attributes: titles, descriptions, and links, as in this example.
Note that XML differs from HTML in requiring end-tags for most
elements.
I’ve broken the URLs onto two lines; because text in HTML
“pre” elements doesn’t wrap, the URLs run off the
edge of narrow windows. You should follow the normal rules with URLs
(such as, “no newlines in URLs”). I added indentation for
readability too; it’s not required.
For brevity, I’ve included one channel and one item. Most site
description files have several items; some have several channels, each
devoted to an author, section, topic, or the like.
Variations are possible in this procedure. For example, as a publisher
you can provide a new site description file containing headlines and
summaries; or you can update a file whose contents are static
(“touch” it), triggering responses from aggregators, which
examine subsidiary files for information on new items. I describe the
first of these two methods because that’s what I use for
Belisarius.
To make your RSS feed available, put the site description file on your
website. Generally, this means either uploading the file to the site
with something like FTP or a browser-based file-transfer program, or
creating a new file directly on the server. Methods differ a great
deal just across blogging systems alone, not even speaking of non-blog
RSS feeds; I call command-line (Windows “Command Prompt”)
FTP from batch files for normal uploads, and use Filezilla for by-hand
transfers.
However you do it, this step consists purely of putting the site
description file on your website. When the file can be accessed like
any other on your site, this step is done.
To let readers subscribe to your RSS feed, put links on your website
to the site description file. The abbreviated file in my example is
called belisarius.rdf; if you want to
look at the text, open the file at the other end of this link.
However, beware: in most configurations, clicking on that link
makes you a Belisarius subscriber as well as showing you the text of
the file (you can always unsubscribe after you’ve examined the
text). An alternative is to download the text file and look at it with
Notepad, Emacs, or the like.
By clicking on the link, readers tell their news aggregator to
subscribe to your site (that is, to add your home URL to its list of
subscribed sites). Since it checks each item on that list at specified
intervals, it’s able to notify readers of updates as soon as
they’re available.
There’s nothing special about the format of this link to the
site description file:
Again, I’ve broken the URL onto multiple lines for readability,
in lieu of automatic line wrapping. You should follow standard rules
for HTML links.
You’ve created a site description file, put it on your website,
and linked to it. Now to make sure the whole setup works:
If this works, you’re done with the basic task. You might want
to consider adding your feed to the big
public ticker. You might want to consider automating some of these
tasks or looking at alternative implementations, too. If you
don’t want to do these things, you’re done.
If the test didn’t work, you could start by checking for issues
such as these:
You’ve probably seen the news tickers with reports from AP,
Reuters, AFP, and so on streaming across them. There’s a similar
public ticker of RSS feeds, to which you can add yours if you choose.
To add your feed to the public ticker, enter your URL at feed
aggregator websites. Two popular feed aggregators are:
You normally do this once when you create your feed. As of January
2005, basic levels of these services are free.
Each time you update your site, you can announce that fact by
notifying sites that monitor updates. Two popular monitors are:
Both sites have brief forms to fill in, announcing that your
site’s been updated. Again, as of January 2005, basic levels of
these services are free.
Danny Sullivan helpfully expands
on this and related topics at SearchEngineWatch.
If you’re willing to update your site description file by hand,
yes, that’s all there is.
If you update your site frequently, you have a variety of authors, or
otherwise have a more complex site than mine, you’ll probably
want to consider automating the creation of your site description
file. However, I currently have no experience with the automating
tools, so I can make no recommendations.
Researching the page you’re reading, I found that two- and
three-year-old articles about RSS feeds by good writers were reliable
with respect to the big picture, but needed verification on the
detailed level, because standards had changed. Therefore, especially
if you have problems or are doing something exotic, I recommend searching
for newer articles than this on the subject—this one was
originally written in January, 2005 (but check the final line of the
post for the last update).
In this example I’ve used RSS version 2. There are at least two
other popular versions, 1.0 and 0.91. The differences may or may not
matter, depending on what sort of information you want to publish; Google
to make sure. Specifying version 2, I call my my site description file
“belisarius.rdf”. I believe you need to use
“xml” instead of “rdf” if you use RSS version
0.91; I think either works with version 1. But almost all my testing
has been with version 2, so check these statements before depending on
them.
Readers who syndicate your site need a news
aggregator to collect notices from updated sites. News aggregators
are programs that check a list of URLs to see if they’ve been
updated.
The article
I mentioned earlier has brief summmaries of some popular aggregators
(at the time it was written).
News aggregators are sometimes incorporated into email programs and
browsers. For example, my news aggregator is the same program I use
for browsing and email: Opera. I’m one of several contributers
to Bad Attitudes, so I
subscribe to it. When I open my Mail panel, I see bold headings and
counts for new email, and for new posts at Bad Attitudes and other
sites I subscribe to. Expanding those headings leads to an email-like
message for each new post; from Bad Attitudes, I get a title, a brief
description, and a URL.
When your site description file is updated, news aggregators flag your
site to their readers. For example, I set Opera to check the Bad
Attitudes feed for updates every five minutes. Every five minutes
(when I’m on the web), Opera contacts the Bad Attitudes site and
checks the site description file. If it’s been updated since the
last time Opera checked, Opera bolds the Bad Attitudes entry in my
Mail panel and shows a count of new posts there. Email notifications
and syndication updates are condensed onto a single panel. (Norwegian
browsers rule!)
I hope this brief introduction has been helpful. If you find errors or
have suggestions for improving this document, please use the comment
form below to let me know. Thanks!
What’s an RSS feed?
To create an RSS feed
Create a text file
<?xml version="1.0" ?>
<rss version="2.0">
<channel>
<title>Belisarius Blogs!</title>
<description>A forum for discussion of civic life
</description>
<link>http://home.earthlink.net
/~count_belisarius/</link>
<item>
<title>A Platform for a Party of the Left</title>
<description>
What's a reasonable platform for a party of the
left? The 2004 Democrats were hopeless, and the
Green platform seemed to be Elect the Democrat.
Here's my first cut at a platform I call
Full Employment, Fair Care.
</description>
<link>http://home.earthlink.net
/~count_belisarius/platform1.htm</link>
</item>
</channel>
</rss>
Put the file on your website
Link to the file
<a
href="http://home.earthlink.net
/~count_belisarius/belisarius.rdf">
RSS Syndicate this site</a>
Validate and test your feed
Did it work?
Announce your updates
Is that all there is?
Caveats
Subscribers need a news aggregator
Comments and errors