XML::RSS::Tools 0.16 review

Download
by rbytes.net on

XML::RSS::Tools is a tool-kit providing a wrapper around a HTTP client, a RSS parser, and a XSLT engine. SYNOPSIS use XML::RS

License: Perl Artistic License
File size: 32K
Developer: Adam Trickett
0 stars award from rbytes.net

XML::RSS::Tools is a tool-kit providing a wrapper around a HTTP client, a RSS parser, and a XSLT engine.

SYNOPSIS

use XML::RSS::Tools;
my $rss_feed = XML::RSS::Tools->new;
$rss_feed->rss_uri('http:://foo/bar.rdf');
$rss_feed->xsl_file('/my/rss_transformation.xsl');
$rss_feed->transform;
print $rss_feed->as_string;

RSS/RDF feeds are commonly available ways of distributing or syndicating the latest news about a given web site. Weblog (blog) sites in particular are prolific generators of RSS feeds. This module provides a VERY high level way of manipulating them. You can easily use LWP, the XML::RSS and XML::LibXSLT do to this yourself, but this module is a wrapper around these modules, allowing for the simple creation of a RSS client.

When working with XML if the file is invalid for some reason this module will croak bringing your application down. When calling methods that deal with XML manipulation you should enclose them in an eval statement should you wish your program to fail gracefully.

Otherwise method calls will return true on success, and false on failure. For example after loading a URI via HTTP, you may wish to check the error status before proceeding with your code:

unless ($rss_feed->rss_uri('http://this.goes.nowhere/')) {
print "Unable to obtain file via HTTP", $rss_feed->as_string(error);
# Do what else
# you have to.
} else {
# carry on...
}
Check the HTML documentation for extra examples, and background.

Requirements:
Perl

XML::RSS::Tools 0.16 keywords