App-Rssfilter

 view release on metacpan or  search on metacpan

lib/App/Rssfilter.pm  view on Meta::CPAN

    - My::Custom::Matcher: My::Custom::Filter

L<App::Rssfilter::Rule> has more examples of writing your own matching & filtering code. Note that any changes made to the item by the matcher are preserved (for the time being).

=head2 Using App::Rssfilter to fetch RSS feeds

To use App::Rssfilter in your own project, create an L<App::Rssfilter::Group>, add feeds and rules and subgroups, then call its C<update> method. To load and save feeds to something other than the file system, extend L<App::Rssfilter::Feed::Storage> ...

=head1 BUGS

Only the current and last-fetched RSS documents are examined when filtering, so an item may not be classified as a duplicate and thus appear in two feeds. To illustrate, consider two RSS news feeds: National, which is frequently updated and contains ...

This can be mitigated by filtering Regional before National, or by fetching the National feed less frequently.

=head1 SEE ALSO

=over 4

=item *

L<Yahoo Pipes|http://pipes.yahoo.com/pipes/>

lib/App/Rssfilter/Group.pm  view on Meta::CPAN

=head2 logger

This is a object used for logging; it defaults to a L<Log::Any> object. It is provided by the L<App::Rssfilter::Logger> role.

=head2 name

This is the name of the group. Group names are used when storing a feed so that feeds from the same group are kept together. The default value is '.' (a single period).

=head2 storage

This is a feed storage object for feeds to use when they are updated. The default value is a fresh instance of L<App::Rssfilter::Feed::Storage>. See L</update> for details on when the default value is used.

=head2 groups

This is an arrayref of subgroups attatched to this group.

=head2 rules

This is an arrayref of rules to apply to the feeds in this group (and subgroups).

=head2 feeds

lib/App/Rssfilter/Group.pm  view on Meta::CPAN

=head1 METHODS

=head2 update

    $group->update( rules => $rules, storage => $storage );

Recursively calls C<update> on the feeds and subgroups of this group.

C<$rules> is an arrayref of additional rules to constrain the feed and groups, in addition to the group's current list of rules.

C<$storage> is the feed storage object that feeds and subgroups will use to store their updated contents. If not specified, groups will use their default C<storage>. The group's C<name> is appended to the current path of C<$storage> before being pass...

=head2 add_group

    $group = $group->add_group( $app_rssfilter_group | %group_options );

Adds C<$app_rssfilter_group> (or creates a new App::RssFilter::Group instance from the C<%group_options>) to the list of subgroups for this group. Returns this group (for chaining).

=head2 group

    my $subgroup = $group->group( $name );

t/lib/App/Rssfilter/Group/Test/UpdatedFeed.pm  view on Meta::CPAN


requires 'do_update';
requires 'mock_feed';
requires 'path_pushed_storage';
requires 'rules_for_update';

before 'do_update' => method( $group ) {
    $group->add_feed( $self->mock_feed );
};

test updated_feed => method {
    $self->mock_feed->called_ok( 'update', 'called update on nested feed ...');

    my (undef, %feed_update_args) = $self->mock_feed->call_args(0);

    is_deeply(
           $feed_update_args{storage},
           $self->path_pushed_storage,
           '... and passed path_push storage to nested feed when updating'
    );

t/lib/App/Rssfilter/Group/Test/UpdatedGroup.pm  view on Meta::CPAN

requires 'do_update';
requires 'group';
requires 'mock_group';
requires 'path_pushed_storage';
requires 'rules_for_update';

before 'do_update' => method( $group ) {
    $group->add_group( $self->mock_group );
};

test updated_group => method {
    $self->mock_group->called_ok( 'update', 'called update on nested group ...');

    my (undef, %group_update_args) = $self->mock_group->call_args(0);

    is_deeply(
           $group_update_args{storage},
           $self->path_pushed_storage,
           '... and passed path_push storage to nested group when updating'
    );



( run in 0.963 second using v1.01-cache-2.11-cpan-39bf76dae61 )