XML::RSS::Aggregate - RSS Aggregator
my $rss = XML::RSS::Aggregate->new( # parameters for XML::RSS->channel() title => 'Aggregated Examples', link => 'http://blog.elixus.org/', # parameters for XML::RSS::Aggregate->aggregate() sources => [ qw( http://one.example.com/index.rdf http://another.example.com/index.rdf http://etc.example.com/index.rdf ) ], sort_by => sub { $_[0]->{dc}{subject} # default to sort by dc:date }, uniq_by => sub { $_[0]->{title} # default to uniq by link } ); $rss->aggregate( sources => [ ... ] ); # more items $rss->save("all.rdf");
This module implements a subclass of XML::RSS, adding a single aggregate method that fetches other RSS feeds and add to the object itself. It handles the proper ordering and duplication removal for aggregated links.
aggregate
Also, the constructor new is modified to take arguments to pass implicitly to channel and aggregate methods.
new
channel
All the base methods are still applicable to this module; please see XML::RSS for details.
This method fetches all RSS feeds listed in @url and pass their items to the object's add_item.
@url
add_item
The optional sort_by argument specifies the function to use for ordering RSS items; it defaults to sort them by their {dc}{date} attribute (converted to absolute timestamps), with ties broken by their {link} attribute.
sort_by
{dc}{date}
{link}
The optional uniq_by argument specifies the function to use for removing duplicate RSS items; it defaults to remove items that has the same {link} value.
uniq_by
XML::RSS
Autrijus Tang <autrijus@autrijus.org>
Copyright 2002 by Autrijus Tang <autrijus@autrijus.org>.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
See http://www.perl.com/perl/misc/Artistic.html
To install XML::RSS::Aggregate, copy and paste the appropriate command in to your terminal.
cpanm
cpanm XML::RSS::Aggregate
CPAN shell
perl -MCPAN -e shell install XML::RSS::Aggregate
For more information on module installation, please visit the detailed CPAN module installation guide.