Timothy Appnel > XML-RSS-Parser-0.21 > XML::RSS:Parser

Download:
XML-RSS-Parser-0.21.tar.gz

Annotate this POD

CPAN RT

New  1
Open  6
View/Report Bugs
Source   Latest Release: XML-RSS-Parser-1.02

NAME ^

XML::RSS:Parser - A liberal parser for RSS Feeds.

SYNOPSIS ^

        #!/usr/bin/perl -w
        
        use strict;
        use XML::RSS::Parser;
        use URI;
        use LWP::UserAgent;
        use Data::Dumper;
        
        my $ua = LWP::UserAgent->new;
        $ua->agent('XML::RSS::Parser Test Script');
        my @places=( 'http://www.mplode.com/tima/xml/index.xml' );
        
        my $p = new XML::RSS::Parser;
        
        foreach my $place ( @places ) {
        
                # retreive feed
                my $url=URI->new($place);
                my $req=HTTP::Request->new;
                $req->method('GET');
                $req->uri($url);
                my $feed = $ua->request($req);
        
                # parse feed
                $p->parse( $feed->content );
        
                # print feed title and items data dump to screen
                print $p->channel->{ $p->ns_qualify('title', $p->rss_namespace_uri ) }."\n";
                my $d = Data::Dumper->new([ $p->items ]);
                print $d->Dump."\n\n";
        
        }

DESCRIPTION ^

XML::RSS::Parser is a lightweight liberal parser of RSS feeds that is derived from the XML::Parser::LP module the I developed for mt-rssfeed -- a MovableType plugin. This parser is "liberal" in that it does not demand compliance to a specific RSS version and will attempt to gracefully handle tags it does not expect or understand. The parser's only requirement is that the file is well-formed XML. The module is leaner then XML::RSS -- the majority of code was for generating RSS files.

Your feedback and suggestions are greatly appreciated. See the TO DO section for some brief thoughts on next steps.

This modules requires the XML::Parser package.

METHODS ^

The following methods are available:

SEE ALSO ^

XML::Parser, http://feeds.archive.org/validator/, http://www.xml.com/pub/a/2002/12/18/dive-into-xml.html, http://www.oreillynet.com/pub/a/webservices/2002/11/19/rssfeedquality.html,

TO DO AND ISSUE ^

LICENSE ^

The software is released under the Artistic License. The terms of the Artistic License are described at http://www.perl.com/language/misc/Artistic.html.

AUTHOR & COPYRIGHT ^

Except where otherwise noted, XML::RSS::Parser is Copyright 2003, Timothy Appnel, tima@mplode.com. All rights reserved.

syntax highlighting: