XML::RSS::LibXML - XML::RSS with XML::LibXML (parse-only)
use XML::RSS::LibXML; my $rss = XML::RSS::LibXML->new; $rss->parse_file($file); print "channel: $rss->{channel}->{title}\n"; foreach my $item (@{ $rss->{items} }) { print " item: $item->{title} ($item->{link})\n"; }
XML::RSS is an extremely handy tool, but it is unfortunately not exactly the most lean or efficient RSS parser, especially in a long-running process. So for a long time I had been using my own version of RSS parser to get the maximum speed and efficiency - this is the re-packaged version of such module, such that it adheres to the XML::RSS interface.
It uses XML::LibXML as the underlying XML parser, and is therefore much much faster than XML::RSS
YMMV, but in reality, I do not parse RSS files this way -- because where performance matters, it is important to *NOT* store unnecessary data in memory. So do note that while this module may achieve what XML::RSS does faster, but it's not the solution.
Creates a new instance of XML::RSS::LibXML
Parse a string containing RSS.
Parse an RSS file specified by $filename
Here's a simple benchmark using benchmark.pl in this distribution:
daisuke@localhost XML-RSS-LibXML$ perl -Mlib=lib benchmark.pl index.rdf Rate rss rss_libxml rss 8.00/s -- -97% rss_libxml 262/s 3172% --
No support whatsover for writing RSS. No plans to support it either.
Tests. Currently tests are simply stolen from XML::RSS.
XML::RSS, XML::LibXML, XML::LibXML::XPathContext
Copyright 2005 Daisuke Maki <dmaki@cpan.org>. All rights reserved. Development funded by Brazil, Ltd. <http://b.razil.jp>
To install XML::RSS::LibXML, copy and paste the appropriate command in to your terminal.
cpanm
cpanm XML::RSS::LibXML
CPAN shell
perl -MCPAN -e shell install XML::RSS::LibXML
For more information on module installation, please visit the detailed CPAN module installation guide.