Developer Forums | About Us | Site Map
Search  
HOME > TUTORIALS > SERVER SIDE CODING > PERL TUTORIALS > AN INTRODUCTION TO RSS NEWS FEEDS


Sponsors





Useful Lists

Web Host
site hosted by netplex

Online Manuals

An introduction to RSS news feeds
By James Lewin - 2004-04-05 Page:  1 2 3 4 5 6

Using open formats for content syndication

RDF Site Summary (RSS) is catching on as one of the most widely used XML formats on the Web. Find out how to create and use RSS files and learn what they can do for you. See why companies like Netscape, Userland, and Moreover use RSS to distribute and syndicate article summaries and headlines. This article includes sample code that demonstrates elements of an RSS file, plus a Perl example using the module XML::RSS.

RDF Site Summary (RSS) files, based on XML, provide an open method of syndicating and aggregating Web content. Using RSS files, you can create a data feed that supplies headlines, links, and article summaries from your Web site. These files describe a channel of information that can include a logo, a site link, an input box, and multiple "news items." Other sites can incorporate your information into their pages automatically. You can also use RSS feeds from other sites to provide your site with current news headlines. These techniques let you draw more visitors to your site and also provide them with up-to-date information.

What are metadata?

RSS files are a type of metadata. Metadata are:
  • units of information about information.
  • commonly used to provide descriptive information about the content, context, and characteristics of data.
HTML keywords and description metatags are examples of metadata, and are used to provide information about Web pages.

The RSS format originated with the sites My Netscape and My UserLand, both of which aggregate content derived from XML news feeds. Because it's one of the simplest XML applications, RSS found favor with many developers who need to perform similar tasks. Users include Moreover, Meerkat, UserLand, and XML Tree. This article looks at the RSS format and examines some open source Perl modules that will allow you to work with RSS files easily.


What exactly are these RSS files?

RSS files are metadata (see the sidebar What are metadata?). Until you've used them or seen an example, it may not be easy to understand what RSS files are, but they are easy to create. An RSS file commonly contains four main types of elements: channel, image, items, and text input. These elements are easy to identify and code, as the example in Listing 1 demonstrates. An example of an item within an RSS 0.91 file, Listing 1 contains three easily identifiable parts: a title, a link, and a description.


<item>
     
<title>Mozilla Dispenses with Old, Proprietary DOM</title>

<link>http://www.mozillazine.org/talkback.html?article=604</link>
<description>The Mozilla team has decided to forgo backwards compatibility with Netscape's proprietary DOM.</description>

In headline collections published as results of RSS file aggregations, HTML normally renders the specified title as a headline. The title usually also serves as a link, using the URL listed in the link element. Finally, the description is normally displayed as a summary of the article underneath the headline.



View An introduction to RSS news feeds Discussion

Page:  1 2 3 4 5 6 Next Page: Creating RSS files

First published by IBM developerWorks


Copyright 2004-2024 GrindingGears.com. All rights reserved.
Article copyright and all rights retained by the author.