NAME

XML::Feed::Aggregator - Perl module for aggregating feeds

SYNOPSIS

use URI;
use XML::Feed;
use XML::Feed::Aggregator;

# construction with URIs / XML::Feed / strings
my @sources = [ URI->new('http://rss.slashdot.org/Slashdot/slashdot'),
  'http://use.perl.org/index.rss',
  XML::Feed->parse(URI->new("http://planet.perl.org")) ];

my $agg = XML::Feed::Aggregator->new({sources => \@sources});

# sort entries by date
$agg->sort;

# or descending order
$agg->sort('desc');

my $d = $agg->deduplicate;
say "removed $d duplicates";

# loop through XML::Feed::Entry objects 
for ($agg->entries) {
    say $_->title;
    say $_->content;
}

# get new aggregated XML::Feed object
my $feed = $agg->feed;

# loop through errors;
warn $_ for ($agg->errors);

DESCRIPTION

This module aggregates feeds into a single XML::Feed object

CONSTRUCTION

List of feeds to be aggregated:

sources - ArrayRef of URI's, URL Strings and XML::Feed objects

Parameters for the new feed object ( see XML::Feed for more params )

new_feed => { 
   title => 'New aggregated feed', 
   link => 'http://www.your.com/feed.rss',
   author => 'Jim Bob',
}

METHODS

sort

sort feed by date

deduplicate

removed duplicated entries from the feed

feed

returns the new XML::Feed object

entries

return list of feed entries

sources

return list of the source XML::Feed's

since

takes a DateTime object and returns any entries since that date

errors

returns list of errors that have occured

CONTRIBUTE

git://github.com/robinedwards/XM-Feed-Aggregator.git

SEE ALSO

XML::Feed XML::Feed::Deduper Feed::Find

AUTHOR

Robin Edwards, <rge@cpan.org>

COPYRIGHT AND LICENSE

Copyright (C) 2010 by Robin Edwards

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.12.1 or, at your option, any later version of Perl 5 you may have available.