April 2005
Intermediate to advanced
270 pages
7h 13m
English
Despite the additional complexity of the RDF attributes, the methods for creating RSS 1.0 feeds are similar to those used to create RSS 2.0 feeds (discussed in Chapter 4).
The
XML::RSS module used in Chapter 4 also works for RSS 1.0, with a few changes
to the scripts. The script in Example 5-8 produces
the feed shown, in turn, in Example 5-9.
#!/usr/bin/perl -w use XML::RSS; my $rss = new XML::RSS( version => '1.0' ); $rss->channel( title => "The Title of the Feed", link => "http://www.oreilly.com/example/", description => "The description of the Feed", dc => { date => "2000-08-23T07:00+00:00", subject => "Linux Software", creator => 'scoop@freshmeat.net', publisher => 'scoop@freshmeat.net', rights => "Copyright 1999, Freshmeat.net", language => "en-us", }, ); $rss->image( title => "Oreilly", url => "http://meerkat.oreillynet.com/icons/meerkat-powered.jpg", link => "http://www.oreilly.com/example/", dc => { creator => "G. Raphics (graphics at freshmeat.net)", }, ); $rss->textinput( title => "Search", description => "Search the site", name => "query", link => "http://www.oreilly.com/example/search.cgi" ); $rss->add_item( title => "Example Entry 1", link => "http://www.oreilly.com/example/entry1", description => 'blah blah', dc => { subject => "Software", }, ); $rss->add_item( title => "Example Entry 2", link => "http://www.oreilly.com/example/entry2", description => 'blah blah' ); $rss->add_item( ...Read now
Unlock full access