App::Rssfilter::Match::AbcPreviews - match an ABC preview RSS item
version 0.07
use App::Rssfilter::Match::AbcPreviews; use Mojo::DOM; my $rss = Mojo::DOM->new( <<"End_of_RSS" ); <rss> <channel> <item> <guid>http://www.abc.net.au/preview/some_article</guid> <description>here is an article which is in preview mode</description> </item> <item> <guid>http://www.abc.net.au/entertainment/new-preview-of-movie</guid> <description>here is an article about a preview of a movie</description> </item> </channel> </rss> End_of_RSS print $_, "\n" for $rss->find( 'item' )->grep( \&App::Rssfilter::Match::AbcPreviews::match ); # or with an App::Rssfilter::Rule use App::Rssfilter::Rule; App::Rssfilter::Rule->new( condition => 'AbcPreviews', action => sub { print shift->to_xml, "\n" }, )->constrain( $rss ); # either way, prints # <item> # <guid>http://www.abc.net.au/preview/some_article</guid> # <description>here is an article which is in preview mode</description> # </item>
This module will match an RSS item if its GUID contains 'preview', unless 'preview' is also in the title of the item. The Australian Broadcasting Corporation RSS feeds occasionally include items whose GUIDS contain 'preview' and link to non-existent pages, so this matcher was created to find them.
preview
my $item_is_preview = App::Rssfilter::Match::AbcPreviews::match( $item );
Returns true if $item contains 'preview' in its GUID and not in its title.
$item
App::Rssfilter
App::Rssfilter::Rule
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.