1
0
Fork 0
mirror of https://github.com/perlbot/perlbuut synced 2025-06-07 10:25:42 -04:00
perlbuut/plugins/.svn/text-base/rss.pm.svn-base
2009-12-05 00:02:04 -05:00

22 lines
547 B
Text

use XML::RSS::Parser;
use strict;
sub {
my( $said, $pm ) = @_;
my $feed_uri = $said->{recommended_args}->[0];
print "Couldn't find a url to fetch!" and return
unless $feed_uri;
my $parser = XML::RSS::Parser->new;
my $feed = $parser->parse_uri( $feed_uri ) #TODO check for http:// schema
or ( print "Couldn't parse $feed_uri because", $parser->errstr and return );
for( $feed->query("//item/title") ) {
print $_->text_content;
}
}
__DATA__
Returns small list of headlines from an RSS feed. Syntax, fetch_rss http://example/rss