XML::RSS::Tools > Simple Introduction

# Simple Introduction To RSS

## RSS/RDF

Rich Site Summary/Resource Description Framework technology is a simple method of a site describing what it has, so that another site can summarise the content, and provide links back to the original content.

RSS was pioneered by Netscape Communications for their my.netscape portal, and adopted quickly by many others, notably userland.com.

## XML

A simple XML file is produced by the site originating the articles. This file, easily obtainable by HTTP, is downloaded and parsed by the client, allowing the client to present the site summary in a way that suits the client. XML provides a simple human readable format that is easy to generate and read, using typical web tools.

## Principle

The module came from a simple idea, gather RSS feeds, convert them into HTML fragments and then template them into a web page on a local web server.

### Downloading RSS files

Originally I used wget, to pull files down from their server. Other tools to do this include cURL and any web browser. I cached the RSS feeds on my web server's disk space to reduce unnecessary downloading.

### RSS Normalisation

RSS feeds come in several incompatible families. To make conversion to HTML simple I opted to convert all RSS feeds to RSS version 0.91 as this is very simple to convert to HTML via XSLT. You can turn off normalisation if you plan to use just one XSLT stylesheet.

The underlying XML::RSS (up to version 0.97) core can parse and interconvert RSS Versions 0.9, 0.91 and 1.0, versions of XML::RSS 0.98 and beyond can additionally process RSS version 2.0, though it is unlikley to ever be able to process the largly unused versions 0.92, 0.93, and 0.94, which are the evolutionary steps from 0.91 to 2.0.

### RSS Conversion

Most online examples of RSS use the XML::RSS module to programmatically convert the feed into HTML, either directly or via using one of the many quality HTML templating tools. This I felt was inefficient and so I opted to use "XML Stylesheet Language Transformation", which is industry standard and does not require programming. There are several XSLT processors available: Saxon, Xalan, MSXML, and Sablotron, however the fastest and easiest one for Perl is Matt Sergeant's XML C Library for Gnome based LibXSLT.

### Script to Module

After developing the script to do this I realised that much of the code could be converted into a module and distributed to the world. After a popular post to Perlmonks, I have moved the module up to CPAN. The code should be considered as beta code, and the API may be extended in the future.

## Examples

Some basic examples of how to use this module are provided in the examples folder. Simple explanations can be found here:

- Example 1 - simple example
- Example 2 - complete example
- Example 3 - consise example
- Example 4 - single stylesheet example with no normalisation
- Processing RSS with XSLT - an article from The Perl Review

## Resources

- Userland.com the home of key RSS developments: backend.userland.com
- SOAP Client RSS to HTML online tool: soapclient.com/rss/rss.html
- Netscape Communications: my.netscape.com/publish/formats/rss-spec-0.91.html
- W3C Standards body: www.w3.org/RDF/ & Validator: www.w3.org/RDF/Validator/
- Blogspace RSS FAQ: blogspace.com/rss/
- RSS Versions: www.webreference.com/authoring/languages/xml/rss/1.8.html
- Ben Hammersley's Content Syndication with XML and RSS: rss.benhammersley.com
- Dave Beckett's Resource Description Framework Resource Guide: www.ilrt.bristol.ac.uk/discovery/rdf/resources/
- Mark Pilgrim and Sam Ruby's RSS Validator: feeds.archive.org/validator/
- `brian d foy` has an interesting, article in The Perl Review: www.theperlreview.com/Issues/v0i6.shtml
- Mark Pilgrim has some nice RSS articles on XML.com (in Python): What is RSS?; Parsing RSS At All Costs and Inside the RSS Validator
- Bob DuCharme wrote a simple introduction to using XSLT with RSS on XML.com: Never Mind the Namespaces: An XSLT RSS Client
- The Perl-RSS Group has a nice selection of articles on the XML:RSS Site: XML::RSS | Bibliography

## Some Example RSS Feeds

- www.bbc.co.uk/syndication/feeds/news/ukfs_news/front_page/rss091.xml
- www.guardian.co.uk/rss/
- freshmeat.net/backend/fm.rdf
- slashdot.org/slashdot.rdf
- www.oreillynet.com/meerkat/?_fl=rss10
- www.theregister.co.uk/tonys/slashdot.rdf - this one is often malformed.
- www.sophos.com/virusinfo/infofeed/tenalerts.xml
- www.perl.com/pace/perlnews.rdf

Copyright iredale Consulting 2002-2003