App::Rssfilter::Feed - Get the latest or previous version of an RSS feed
version 0.07
use App::Rssfilter::Feed; my $feed = App::Rssfilter::Feed->new( filename => 'http://get.your.files/here.rss' ); # shorthand for $feed = App::Rssfilter::Feed->new( name => 'filename', url => 'http://get.your.files/here.rss', ); my $rule = App::RssFilter::Rule->new( condition => 'A Matcher', action => 'A Filter', ); $feed->add_rule( $rule ); $feed->add_rule( condition => 'Another Matcher', action => 'Another Filter', ); $feed->update; ### or with App::Rssfilter::Group use App::Rssfilter::Group; my $group = App::RssFilter::Group->new( 'Tubular' ); $group->add_feed( RadName => 'http://r.a.d.i.c.al/feed.rss' ); # shorthand for $group->add_feed( App::Rssfilter::Feed->new( RadName => 'http://r.a.d.i.c.al/feed.rss' ) ); $group->update;
This module fetches the latest version of an RSS feed from a URL and constrains it with its list of rules.
It consumes the App::Rssfilter::Logger role.
This is a object used for logging. It defaults to a Log::Any object. It is provided by the App::Rssfilter::Logger role.
This is the name of the feed to use when storing it, and is required. This will be used by the default storage as the filename to store the feed under.
storage
This is the URL to fetch the latest feed content from, and is required.
This is the arrayref of rules which will constrain newly-fetched feeds. It defaults to an empty arrayref.
This is a Mojo::UserAgent to use to fetch this feed's url. It defaults to a new Mojo::UserAgent.
url
This is the App::Rssfilter::Feed::Storage to store newly-fetched iRSS documents, or retrieve the previously-fetched version. It defaults to a new App::Rssfilter::Feed::Storage, with its name set to this feed's name.
$feed->add_rule( $rule )->add_rule( %rule_parameters );
Adds the $rule (or creates a new App::RssFilter::Rule from the passed parameters) to the rules.
$rule
$feed->update( rules => $rules, storage => $storage );
This method will:
download the RSS feed from the URL, if it is newer than the previously-saved version
apply the rules to the new RSS feed
save the new RSS feed
apply the rules to the old RSS feed
The old feed has rules applied to it so that any group-wide rules will always see all of the latest items, even if a feed does not have a newer version available.
The parameters are optional. $rules should be an arryref of additional rules to be added to the feed's rules for this update only. $storage should be an App::Rssfilter::Feed::Storage that will used instead of this feed's storage to load/save RSS doucments.
$rules
rules
$storage
App::RssFilter::Feed::Storage
App::RssFilter::Group
App::RssFilter::Rule
App::RssFilter
Daniel Holz <dgholz@gmail.com>
This software is copyright (c) 2013 by Daniel Holz.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install App::Rssfilter, copy and paste the appropriate command in to your terminal.
cpanm
cpanm App::Rssfilter
CPAN shell
perl -MCPAN -e shell install App::Rssfilter
For more information on module installation, please visit the detailed CPAN module installation guide.