XML::RSS::Headline::PerlMonks - Subclass of XML::RSS::Headline for reading RSS feed from perlmonks.org
use XML::RSS::Feed; use XML::RSS::Headline::PerlMonks; use LWP::Simple qw(get); my $feed = XML::RSS::Feed->new( 'name' => 'newmonknodes', 'url' => 'http://perlmonks.org/index.pl?node_id=30175;xmlstyle=rss', 'hlobj' => 'XML::RSS::Headline::PerlMonks', 'tmpdir' => '/tmp', # for caching ); while (1) { $feed->parse( get( $feed->url ) ); for my $post ( $feed->late_breaking_news ) { print "New perlmonks posting from " . $post->authortitle . "\n"; print "Category: " . $post->category . "\n"; print "Subject: " . $post->headline . "\n"; print "Link: " . $post->url . "\n\n"; } sleep( $feed->delay ); }
This module extends the base XML::RSS::Headline package which is used by XML::RSS::Feed to parse and optionally cache the RSS feed from perlmonks.org. Optionally this module can be used inside the POE::Component::RSSAggregator module as one of many feeds to monitor.
item()
This overrides the item() method in XML::RSS::Headline and adds the parsing of item nodes which use the perlmonks namespace.
These are new attributes that come from nodes using the perlmonks namespace. With the exception of category(), they are all simple getter/setter methods. Category does some translation from the perlmonks abbreviation for category to a prettier description as used in perlmonks' menus
category() authortitle() author_user() mode_id() createtime()
XML::RSS::Feed, XML::RSS::Headline, POE::Component::RSSAggregator
http://perl.donshanks.com/modules
Please report any bugs or feature requests to bug-xml-rss-headline-perlmonks [at] rt [dot] cpan [dot] org or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=XML-RSS-Headline-PerlMonks.
bug-xml-rss-headline-perlmonks [at] rt [dot] cpan [dot] org
Thanks to Jeff Bisbee for XML::RSS:Feed, it made my life so much simpler, to the monks at perlmonks.org, and my employer WhitePages.com for giving me time and resources to test things out.
Don Shanks, <donshank [at] cpan [dot] org>
Copyright (C) 2006 by Don Shanks
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.5 or, at your option, any later version of Perl 5 you may have available.
To install XML::RSS::Headline::PerlMonks, copy and paste the appropriate command in to your terminal.
cpanm
cpanm XML::RSS::Headline::PerlMonks
CPAN shell
perl -MCPAN -e shell install XML::RSS::Headline::PerlMonks
For more information on module installation, please visit the detailed CPAN module installation guide.