Lesson 10 - RSS Feeds



welcome to Wreamweaver 8

What is RSS?

RSS stands for Really Simple Syndication.  It is also known as Rich Site Summary.  RSS provides a simple way to share and view headlines and web content while also allowing the user to manage site content.  It was created to automatically inform users regarding updates to their websites or other files without requiring them to have to go to the actual site.  It is extremely useful for sites that constantly change or update their information.  Examples of this would be myyahoo.com and myspace.com which allow the user to determine the site’s content.

Generally, for those who regularly use the web, RSS solves a problem by allowing you to see the latest content from the sites you are interested in without needing to visit each site individually.  Also, with RSS feeds, you do not need to join each site’s e-mail newsletter, ensuring your privacy.  The number of site offering RSS feeds is continually growing including CNN News and the Washington Post along with Yahoo News.

How it works

RSS is used to share content between sites. It allows computers to retrieve and understand information from other computers’ feeds.  This information is then presented through a feed aggregator, which is a program or website that gathers information and sorts the RSS feeds. In order to use it, your RSS feed should describe your site content.  Then, you must register your RSS feed with an aggregator. The aggregator is customized, based on the user’s interests. RSS uses XML to create a text-based file with information regarding a blog, website or podcast.  A new RSS document is saved as an .xml and uploaded to a website.  Once this is done, it allows the aggregator to retrieve the file and read the file’s new information.  Now, the aggregator can display the content.

History of RSS

The name “RSS” encompasses a format that spans a few different versions of at least two (but parallel) formats.  Netscape designed version 0.90, which is considered to be the original RSS.  It was created as a format to build portals of headlines to mainstream news sites, but it was found to be too complex for what it wanted to do.  Therefore, a simpler version, dubbed 0.91, was proposed but then dropped by Netscape when it lost interest in this area of business.

Another vendor, however, named UserLand Software, picked up 0.91 hoping to use it for the company’s weblogging products and other web-based software.  Meanwhile, another group was designing a new format based on RSS 0.90.  This format was based on RDF and is called RSS 1.0.  UserLand did not accept this new format and instead decided to continue to evolve their 0.9x branch producing versions 0.92, 0.93, 0.94 and 2.0.  Therefore, there are now seven different formats called “RSS”.  If you want to make your web content available by syndication, which format should you choose? You will need to be flexible enough to handle all seven variations.

Here is a table from xml.com that contains the seven RSS versions and recommendations.

RSS versions and recommendations

Version Owner Pros Status Recommendation
0.90 Netscape   Obsoleted by 1.0 Don't use
0.91 UserLand Drop dead simple Officially obsoleted by 2.0, but still quite popular Use for basic syndication. Easy migration path to 2.0 if you need more flexibility
0.92, 0.93, 0.94 UserLand Allows richer metadata than 0.91 Obsoleted by 2.0 Use 2.0 instead
1.0 RSS-DEV Working Group RDF-based, extensibility via modules, not controlled by a single vendor Stable core, active module development Use for RDF-based applications or if you need advanced RDF-specific modules
2.0 UserLand Extensibility via modules, easy migration path from 0.9x branch Stable core, active module development Use for general-purpose, metadata-rich syndication


Getting Started with RSS Feeds

There are few ways to get started with RSS, and it all depends on how comfortable you are with editing XML. For that reason, if you haven't gotten comfortable working with the address book XML files, please go back to the first XML lesson, and go over the basics of XML. Editing RSS is as easy as editing and address book, but you need to have your mind around elements, allowed, required, and optoinal child elements, and how attributes work.

You can use feed generators, but I still recommend that you read every line of your RSS feed, it's not hard. You can download and install an RSS extension for Dreamweaver at http://www.rnsoft.com/en/products/rssdreamfeeder/

Editing and Writing RSS

For the hand coders in the audience (I hope there are many) you can start writing RSS using the 2.0 spec. I suggest that you use either Notepad or Dreamweaver to write / copy / edit your RSS. You can save it with an .rss or .xml file extension (or both). Try using .xml first, so that you can preview your files in MSIE. Always, always, always do this to test for well-formedness. If your files don't load, you should get an error statement. Look for unbalanced tags as your first source of error, then misspellings of tags next. Never, never, never add whitespace or line breaks (carriage returns) to an XML document, it can fould up your validation.

The RSS File

At the heart of an RSS file are "items." No matter what version of RSS you settle on, your file will have to include at least one item. Items are generally web pages that you'd like others to link to. For example, let's say you just created a web page reviewing a new cell phone that's being released. Information about that page would form an item. (click here for a longer explanation).

To enter your item into the RSS file, you'll need three bits of information:

  • Title
  • Description
  • Link

The title and description of your item need not match exactly the HTML title tag of the web page that the item refers to, nor the meta description tag, assuming you use these (don't know what they are? See my How To Use HTML Tags article). You can write any title and description that you think will describe the page. However, using your page's title and meta description tag certainly makes it easy to copy and paste to build your RSS feed.

In the case of our example page, let's say this is the information we settle on to define it as an item:

Nokia 3650 Combines Phone And Photos

I've been playing with the new Nokia 3650. Finally, someone has got the combination of a cell phone with digital camera capabilities right!

http://allgadgetsreviewed.com/nokia3650.html

Now we have to surround that information with XML tags. These are similar to HTML tags, with the exception that unlike with HTML, there's no set definition of XML tags. Anyone can make up a particular XML tag. Whether it is useful depends on the program that reads the resulting XML file. In the case of RSS feeds, they have their own unique set of XML tags that are defined. Use these correctly, and then anything that reads RSS will understand your information.

Did that make your head spin? If so, don't reread -- just carry on to see how simple it is. First, open a text editor like Notepad. We're going to build our RSS file using it.

For your title, you need to start it with the <title> tag, then follow this with the text of the title, then end with the </title> tag. It looks like this:

<title>Nokia 3650 Combines Phone And Photos</title>

For your description, you do the same, starting out with the opening <description> tag, then following with the actual description, then "closing" with the </description> tag. Now you have this:

<title>Nokia 3650 Combines Phone And Photos</title>
<description>I've been playing with the new Nokia 3650. Finally, someone has got the combination of a cell phone with digital camera capabilities right!</description>

Next, we add the link information, beginning with <link>, following with the actual hyperlink, then closing with </link>. That gives us this:

<title>Nokia 3650 Combines Phone And Photos</title>
<description>I've been playing with the new Nokia 3650. Finally, someone has got the combination of a cell phone with digital camera capabilities right!</description>
<link>http://allgadgetsreviewed.com/nokia3650.html</link>

Now there's one more thing we need to do. We actually have to define all this information as forming a particular "item," which we do using a special item tag.

You place the opening item tag, <item> at the top or start of all the information we've listed. You then place the closing item tag, </item>, at the bottom or "end" of the item information. The finished product looks like this:

<item>
<title>Nokia 3650 Combines Phone And Photos</title>
<description>I've been playing with the new Nokia 3650. Finally, someone has got the combination of a cell phone with digital camera capabilities right!</description>
<link>http://allgadgetsreviewed.com/nokia3650.html</link>
</item>

Congratulations! You've now made your first item. There's a bit more to do to finish our RSS file. First, what if we have other items we want to syndicate? Then we simply add more item elements, just as we did above. You can have up to 15 items. New items tend to be inserted at the top, with old items removed from the bottom, to make room for new stuff.

With our example, let's see how things look if we add two more items:

<item>
<title>Nokia 3650 Combines Phone And Photos</title>
<description>I've been playing with the new Nokia 3650. Finally, someone has got the combination of a cell phone with digital camera capabilities right!</description>
<link>http://allgadgetsreviewed.com/nokia3650.html</link>
</item>

<item>
<title>Sanyo Tablet PC Amazes!</title>
<description>I was dubious about the new Tablet PCs, but then I saw the latest from Sanyo. Wow, cool looks and it works!</description>
<link>http://allgadgetsreviewed.com/sanyotablet.html</link>
</item>

<item>
<title>Canon MegaTiny Digital Camera Too Small</title>
<description>OK, there is a limit to just how small is too small. Canon's MetaTiny, no larger than a quarter, simply is too little to use properly</description>
<link>http://allgadgetsreviewed.com/metatiny.html</link>
</item>

Having defined items we want to distribute, we now have to define our site as a "channel." You'll use the same tags as with the items: title, description and link. However, this time the information will be about your entire site, rather than a particular page. That means our channel information would look like this:

<title>All Gadgets Reviewed</title>
<description>If it's a gadget, we review it. Learn what gadgets are hot and what's not!</description>
<link>http://allgadgetsreviewed.com</link>

Now, how does something reading our RSS file know that the information above is for our "channel" when it looks just like item information? Simple. As long as we don't surround this information with an opening and closing <item> tags, it won't be seen as item information but rather as channel information. That gives us this:

<title>All Gadgets Reviewed</title>
<description>If it's a gadget, we review it. Learn what gadgets are hot and what's not!</description>
<link>http://allgadgetsreviewed.com</link>

<item>
<title>Nokia 3650 Combines Phone And Photos</title>
<description>I've been playing with the new Nokia 3650. Finally, someone has got the combination of a cell phone with digital camera capabilities right!</description>
<link>http://allgadgetsreviewed.com/nokia3650.html</link>
</item>

<item>
<title>Sanyo Tablet PC Amazes!</title>
<description>I was dubious about the new Tablet PCs, but then I saw the latest from Sanyo. Wow, cool looks and it works!</description>
<link>http://allgadgetsreviewed.com/sanyotablet.html</link>
</item>

<item>
<title>Canon MegaTiny Digital Camera Too Small</title>
<description>OK, there is a limit to just how small is too small. Canon's MetaTiny, no larger than a quarter, simply is too little to use properly</description>
<link>http://allgadgetsreviewed.com/metatiny.html</link>
</item>

There are a few last things we need to do. First, we need to add a tag at the very top of the file saying that this is written according to the XML 1.0 specifications. Right under this, we also have to say what RSS version we are using.

So far, everything we've done is compatible with UserLand's popular RSS 0.91 version. However, it also matches UserLand's latest RSS 2.0 version, as well, so we'll define the file as meeting that specification. This will allow us to add other neat features in the future, if we want.

Finally, after the RSS tag, we need to add an opening "channel" tag. That gives us this at the top of the file:

<?xml version="1.0"?>
<rss version="2.0">
<channel>

At the bottom of the file, after all the items we want to syndicate, we have to insert a closing channel and RSS tag, in that order. Those look like this:

</channel>
</rss>

This means our complete file looks like this:

<?xml version="1.0" ?>
<rss version="2.0">

<channel>

<title>All Gadgets Reviewed</title>
<description>If it's a gadget, we review it. Learn what gadgets are hot and what's not!</description>
<link>http://allgadgetsreviewed.com</link>

<item>
<title>Nokia 3650 Combines Phone And Photos</title>
<description>I've been playing with the new Nokia 3650. Finally, someone has got the combination of a cell phone with digital camera capabilities right!</description>
<link>http://allgadgetsreviewed.com/nokia3650.html</link>
</item>

<item>
<title>Sanyo Tablet PC Amazes!</title>
<description>I was dubious about the new Tablet PCs, but then I saw the latest from Sanyo. Wow, cool looks and it works!</description>
<link>http://allgadgetsreviewed.com/sanyotablet.html</link>
</item>

<item>
<title>Canon MegaTiny Digital Camera Too Small</title>
<description>OK, there is a limit to just how small is too small. Canon's MetaTiny, no larger than a quarter, simply is too little to use properly</description>
<link>http://allgadgetsreviewed.com/metatiny.html</link>
</item>

</channel>

</rss>

Installing and Testing RSS Feeds

When you create your RSS feed - you need to decide whether it is an .rss or . xml file. which one? I suggest you do both. Many people want to look at an XML file and index it, while RSS readers are quite happy reading RSS (.rss). You should create an /rss/ directory at the root level, and put your XML and RSS files into that directory. You should test your RSS feed for 'validity', meaning you have used the correct syntax and grammer. That's fancy talk for DTDs and XSD. Use a feed validator http://feedvalidator.org/ to link to your feed, and check it in a Web browser too! You should also visit http://webdesign.about.com/od/rssvalidators/RSS_Validators.htm to learn more about other tools.

Letting the World Know About Your Feed

There are a number of ways to let search engines know about your feed, and as importantly, about new additions to your feed. I use a list submission tool, which notifies portal aggregation sites, but you can use Google as well. I use a couple tools for that are listed at http://www.rss-specifications.com/rss-tools.htmYou can also use commercial tools like RSS Submit http://www.dummysoftware.com/rsssubmit.html or FeedForAll Partner Solution http://www.feedforall.com/rss-submit-partner.htm just focus on Google submission tools (see week 11 for webmaster tools and techniques). No matter what, remember that RSS feeds need marketing and promoting too!

Using RSS Feeds for Podcasting

Attaching an RSS feed to your website is the fastest way to 'podcast' content directly into a podcast aware application, like iTunes. Building these feeds is straightforward, and you can even add images to the feeds people read. You can hack this by hand, which is characte rbuilding, but requires understanding XML and CDATA coding, or use this Web based PHP tool http://www.tdscripts.com/webmaster_utilities/podcast-generator.php Make sure you test your RSS feed in a RSS aware Web application, and make sure your mp3 files are in the correct directory.

Further reading

Additional Reading      

Safari has identified other books that relate directly to this selection using Self-Organizing Maps (SOM), a neural network algorithm. Please use the list below as a guide for further reading. (Please note that the links are null).

  1. A Brief History of RSS - From Sams Teach Yourself XML in 24 Hours, Third Edition by Michael Morrison
  2. Create RSS with XML::RSS - From XML Hacks by Michael Fitzgerald
  3. Using XML::RSS to Repurpose Data - From Spidering Hacks by Tara Calishain; Kevin Hemenway
  4. Processing RSS Files with XML.RSS - From Perl Template Toolkit by Darren Chamberlain; David Cross; Andy Wardley
  5. RSS: Quick History - From Practical RDF by Shelley Powers
  6. Guess What? Publishing RSS Newsfeeds with Information - From Wicked Cool Java by Brian D. Eubanks
  7. RSS 0.91 and 0.92 (Really Simple Syndication) - From Content Syndication with RSS by Ben Hammersley
  8. Syndicating the Web with RSS News Feeds - From Sams Teach Yourself XML in 24 Hours, Third Edition by Michael Morrison
  9. Describing Your Site in the Feed - From HTML, XHTML, & CSS, Sixth Edition: Visual QuickStart Guide by Elizabeth Castro
  10. Secrets of RSS - From Peachpit Press by Steven Holtzer Peachpit Press ISBN A guided tour of the mysteries of RSS for both readers and publishers ISBN 0-321-42622-3

Copyright © 2008 - 2009 Robert D. Cormia - December 3, 2008