RDF/RSS 1.0 Tutorial in 3 minutes or less
by: Travis M Owens - travisowens@hotmail.com
Date: 10/02/02 - Updated: 10/03/02 10:33am
In a nutshell, RSS 1.0 stands for 'RDF Site Summary', which is an easy way to stream news articles to any XML/RDF/RSS compliant device/program via an XML/RDF syntax. If you really want to read the 1.0 spec then go to http://web.resource.org/rss/1.0/spec. You must note that the different versions of the RSS spec have nothing to do with each other, RSS .91 has nothing to do with RSS 1.0 except for the fact that they both serve news articles. I find RSS 1.0 to be the best of all the RSS specs out there (which are: .91, .92, 1.0, 2.0). What makes the 1.0 spec the best choice is that it has vital tags that the .91 spec didn't have, such as copywrite and date tags. An example of RSS in action within a webpage can be found at http://www.freshnews.org which retrieves all of it's news via RSS streams. There are also numerous programs, a list can be found at http://blogspace.com/rss/readers/ and the best one for the PC that I found was http://www.feedreader.com. As you can see
by installing one of these apps is that there are over 5,000 sources on the net offering news streams.
The actual RSS document is pretty simple. You need to spit out a valid XML HTTP header which should look like "Content-Type: application/xml" (minus the quotes). For the RSS document, the structure is:
<?xml version="1.0" encoding="UTF-8" ?>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns="http://purl.org/rss/1.0/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:syn="http://purl.org/rss/1.0/modules/syndication/"
xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/">
<channel rdf:about="http://www.IndianCountry.com/rss/">
<title>Indian Country Today</title>
<link>http://www.IndianCountry.com</link>
<description>The Nation's Leading Native American Indian News Source</description>
<dc:rights>Copyright 2002 Indian Country Today</dc:rights>
<dc:date>2002-10-02T15:46</dc:date>
<dc:publisher>Indian Country Today</dc:publisher>
<items>
<rdf:Seq>
<rdf:li resource="http://www.indiancountry.com/?1033569807" />
</rdf:Seq>
</items>
</channel>
<image rdf:about="http://www.indiancountry.com/images/logo-ict-rss.gif">
<title>ICT</title>
<url>http://www.indiancountry.com/images/logo-ict-rss.gif</url>
<link>http://www.indiancountry.com</link>
</image>
<item rdf:about="http://www.indiancountry.com/?1033569807">
<title>Oust Bill Janklow: Start a new day for our children!</title>
<link>http://www.indiancountry.com/?1033569807</link>
<description>Throughout my life, I have followed my grandfather's... [more]</description>
<dc:date>2002-10-02T15:46</dc:date>
</item>
</rdf:RDF>
The date format is a little strange but it appears to be the one that works best in FeedReader.
The <image> block is optional, but if you want your logo to appear above articles then use the block. I haven't seen a reader make use of the 'clicking of image goes to this url'. The image size is really important here, the standard is 88x31 pixels and is the default. You can use up to 140 pixels wide but I would not go larger than that, in fact I insist you stick to the default size as most RSS coders are going to make their app using what the spec expects to receive.
If you read the XML you will notice only 1 article is being served. To output multiple articles you just keep repeating the <item></item> block over and over, pleas note that you MUST also repeat the <rdf:li resource="..."> block near the top of the document. While RSS .91 was limited to 15 articles per feed, there is no limit mentioned for RSS 1.0. The only thing that might get you, which caused problems for me, is that your article's <description> cannot be very long. When I tried to output the industry's standard for an abstract, being the first paragraph of a news article, non of the parsers would show any articles, and when viewed in IE I got an XML error. By the looks of it the spec doesn't allow for more 500 characters worth of words in an article's abstract.
If you want to learn more about RSS, I suggest these sites: Why would you use RSS?, O'Reilly's RSS Portal, IBM's RSS Intro, the best FAQ on RSS I've seen and it's alternate url and last of all a tutorial for .91 and 1.0.
-= Info =-
Travis Owens is a Solutions Developer (web design, perl, php, C#, .NET, database, unix admin) living in central New York. He spends his free time studying up on new technologies, feeding his three cats (What kind of web designer doesn't have a cat?) and throwing parties. At the time of this writing you can find more at http://216.244.96.20/travis/
Keywords: 3orless xml rss rdf rich site summary