Getting a good start in any new technology or programming
language often depends on finding the best available information. The
TechRepublic QuickStart Tools give you the information you need to
quickly grasp the fundamentals of developing in a new IDE, using a new
programming language, or working with a new development tool.

Really Simple Syndication (RSS) is a
Web content syndication format that is designed to organize, manage, and share
data available on the Internet. Each RSS text file contains dynamic information
about the Web content and static information about the site using it.
Therefore, Web sites, developers, and organizations that manage content in a
dynamic way use this format.

Besides explaining the basics, the TechRepublic QuickStart
Tools show common tasks, expose strengths and weaknesses, demonstrate some of the
best uses of RSS versions 0.9 and 2.0, and list a variety of other online and
offline resources that can help you build a solid foundation of practical
knowledge.

Language

Fundamentals

Really Simple Syndication (RSS) was originally developed by
Netscape as a format for building news portals. It was based on the Extensible Markup Language (XML) and the Resource Description Framework (RDF). RDF is
a structured model mainly used for detailing metadata on the Web.

RSS is a dialect of XML, and therefore, all RSS files must
adhere to the XML 1.0 specifications laid down by the World Wide Web
Consortium. The file is a structured list encoded so that it can be aggregated
by another program. RSS feeds are used to integrate and distribute dynamic
information.

A Sample News feed

Using RSS, we will create a sample news feed.

Begin

RSS is not a programming language but an XML-based markup
language. It is used to mark up news feeds. The markups in our example show you
how to mark up a news item called the “British Broadcasting Corporation News”
in RSS versions 0.9 and 2.0.

Using
RSS Version 0.9

<rss>
      <channel>
            <title> British Broadcasting Corporation News </title>
            <link>http://something.com/</link>
            <description>British Broadcasting Corporation News Example </description>
      </channel> 
<item>
            <title> British Broadcasting Corporation News </title>
            <link>http://something.com/bbc.html</link>
      </item>

</rss>

An analysis of the code shows that:

  • The
    code is enclosed within <rss> tags.
  • The
    <channel> tag specifies information about the news channel.
  • The
    <link> tag specifies the URL of a Web site, which contains all the
    news.
  • The
    <item> tag specifies which news items are to be retrieved.

Using
RSS Version 2

<rssxmlns:dc=”http://purl.org/dc/elements/1.1/” >
      <channel>
            <title> British Broadcasting Corporation News </title>
            <link>http://something.com/</link>
            <description>British Broadcasting Corporation News Example </description>
      </channel> 
<item>
            <title> British Broadcasting Corporation News </title>
            <link>http://something.com/bbc.html</link>
            <category>Enterprise Software</category>
            <pubDate>Tue, 18 May 2004 19:15:00 PDT</pubDate>
      </item>

</rss>

The major difference in Version 2.0 is the availability of
optional tags to specify author, category, and publication date. It provides a
namespace called dc to specify these parameters, which is declared as xmlns:dc=http://purl.org/dc/elements/1.1/ in the RSS tag.

Common Tasks

Task

Steps

Add an image to the channel

To add an image for the RSS news channel, use the
following tags after the </channel> tag:

<image><title> British Broadcasting Corporation News
</title>
<url>http://images.something.com/image.gif</url>
<link>http://www.something.com/</link>
</image>

Note: The image should be size 88×31.

Specify an author (Version 2.0)

Use the dc:creater
tag to specify the author of a news item. For example:

      <item>
            <title> British Broadcasting Corporation News
</title>

            <link>http://something.com/bbc.html</link>

            <dc:creator>My Name</dc:creator>
      </item>

Add a date (Version 2.0)

Use the dc:date
tag to specify a date for the item. For example:

      <item>
            <title> British Broadcasting Corporation News </title>

            <link>http://something.com/bbc.html</link>
            <dc:date>Date</dc:date>      </item>

Add a short description

Though the link tag for the news item can be used to
direct the user to the URL to the full news, a short description for a news
item can also be added as shown below:

      <item>
            <title> British Broadcasting Corporation News </title>
            <link>http://something.com/bbc.html</link>
            <description>A Short Description</description>
      </item>

Create a Java reader

Here is a snippet of a Java program that extracts news
items and shows the output using the Java DOM API.

NodeList items = doc.getElementsByTagName(item);
 
 for(inti=0;i<items.getLength();i++)
 {
 Element itemElement = (Element) items.item(i); 
 NodeList titles = itemElement.getElementsByTagName(title);
 Node title = titles.item(0);
 NodeListtitleValues = title.getChildNodes();
 Node titleValue = titleValues.item(0);
 System.out.println(+titleValue.getNodeValue()+.);
 }

Strengths

Strength

Description

Simple and easy to understand

RSS uses common XML. It does not contain complex syntax,
looping structures, or other complex programming rules, and is therefore,
easy to understand and implement.

Multipurpose

RSS technology can be used for various applications and
services, such as content aggregation, threaded discussion forums, document
cataloging, and syndication.

Publishing Tool

The RSS publisher tool can be used to publish dynamic
content onto Web sites, such as news feeds and stock tickers.

Extensible

Users can extend RSS capabilities with XML namespaces to
generate dynamic and static content.

Metadata syndication and aggregation

RSS can act like a mini database containing headlines and
description of news and other content present on a Web site, making
syndication and aggregation easier to implement.

Easily parsed

RSS document can be easily parsed using free or
commercially available parser programs. You can also write your own parsers.

Weaknesses

Weakness

Description

Lack of GUI interface

RSS documents are created without the benefit of a GUI
interface.

Inability to develop high-end applications

You cannot develop high-end applications using RSS as you
can with programming languages, which limits the functionality.

Version incompatibility

Some documents created using one version of RSS cannot be
opened with a different version. For example, an RSS document created using
version .90 is not supported by version 2.0.

Need for RSS Validator

RSS is a markup language, and therefore, does not have a
mechanism for checking syntax errors in the code. RSS code validation
requires an external tool to check for syntax errors.

Requires an external reader

An RSS reader program is required to browse, access, and
read newsfeeds in the RSS format.

Best Uses

Creating and maintaining Web portals

RSS is popular technology for the development of Web sites
that require content aggregation and syndication. RSS acts like a mini database
to consolidate data into a well-organized form within a single source file.

As a source of dynamic content

RSS is an excellent medium for news exchange across the
Internet. Because RSS facilitates searching, reading, and scanning frequently
updated headlines from various sources, users can get regular updates and
information regarding latest happenings around the world when they log on to
their subscribed sites.

Aggregating links to related content

RSS is often used to aggregate and organize related links
together on one Web site.

Online resources

What is RSS?

An article that defines RSS and its uses.

RSS 2.0 Specification

An outline of the RSS 2.0 specification
from the Harvard Law School.

Meet diverse needs by using RSS to aggregate content

Web developers are often asked to create sites that cover
every possible audience need and interest. This is the reason for the
popularity of content aggregator functionality, such as RSS, and why it should
be part of your repertoire.

Introduction to RSS

A basic tutorial introducing the principles associated with
RSS.

RSS Tutorial

A tutorial that explains the features and benefits RSS,
complete with a brief technical overview of the technology involved.

RSS Module Guidelines

This guide explains namespace-based modularization and its
ability to create opportunities for compartmentalized extensibility.

Other resources

Content
Syndication with RSS
, By Ben Hammersley (Author),
2003, ISBN: 0-596-00383-8

Essential Blogging, By Cory Doctorow
(Author), RaelDornfest
(Author), J. Scott Johnson (Author), Shelley Powers (Author), Benjamin Trott (Author), Mena G. Trott (Author), 2002, ISBN:
0-596-00388-9

Perl Cookbook, 2nd Edition, By Tom Christiansen (Author),
Nathan Torkington (Author), 2003, ISBN: 0-596-00313-7

Perl
Template Toolkit
, By Darren Chamberlain (Author), David Cross (Author),
Andy Wardley (Author), 2003, ISBN: 0-596-00476-1

Addition information

Meet diverse needs by using RSS to aggregate content

Deliver RSS content to syndication sites with JSP and
JavaScript

RSS and
You

Parsing the News.com RSS feed with PHP

Randomize your RSS feeds with ColdFusion

Creating
an Online RSS News Aggregator with ASP.NET

Inside the RSS Validator