XML::Feed::Aggregator
version 0.0400
use XML::Feed::Aggregator;
my $syndicator = XML::Feed::Aggregator->new(
sources => [
"http://blogs.perl.org/atom.xml",
"http://news.ycombinator.com/"
],
feeds => [ XML::Feed->parse('./slashdot.rss') ]
)->fetch->aggregate->deduplicate->sort_by_date;
$syndicator->grep_entries(sub {
$_->author ne 'James'
})->deduplicate;
say $syndicator->map_entries(sub { $_->title } );
This module aggregates feeds from different sources for easy filtering and sorting.
XML::Feed::Aggregator - Simple feed aggregator
Sources to be fetched and loaded into the feeds attribute.
Coerces to an ArrayRef of URI objects.
An ArrayRef of XML::Feed objects.
List of XML::Feed::Entry objects obtained from each feed
Convert each source into an XML::Feed object, via XML::Feed->parse()
For a remote address this involves a http request.
Combine all feed entries into a single 'entries' attribute
Export aggregated feed to a single XML::Feed object.
All parameters passed to XML::Feed constructor.
Methods relating to the 'feeds' attribute
Add a new feed to the 'feeds' attribute.
Return all feeds as an Array.
Number of feeds.
Methods relating to the 'entries' attribute
See XML::Feed::Aggregator::Sort
Loop over all entries using $_ within a CodeRef.
Grep through entries using $_ within a CodeRef.
Add a new entry to the aggregated feed.
Number of entries.
Returns all entries as an array
This class consumes the following roles for sorting and deduplication.
XML::Feed::Aggregator::Deduper XML::Feed::Aggregator::Sort
Number of errors occured.
An ArrayRef of errors whilst fetching / parsing feeds.
XML::Feed::Aggregator::Deduper
App::Syndicator Perlanet XML::Feed Feed::Find
Robin Edwards robin.ge@gmail.com
This software is copyright (c) 2011 by Robin Edwards.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.