NAME
XML::Atom::Syndication - a simple lightweight client for consuming Atom syndication feeds.
SYNOPSIS
#!/usr/bin/perl -w
use XML::Atom::Syndication;
my $atomic = XML::Atom::Syndication->instance;
my $doc = $atomic->get('http://www.timaoutloud.org/xml/atom.xml');
my($feed_title)= $doc->query('/feed/title');
print $feed_title->text_value."\n\n";
foreach ($doc->query('//entry')) {
my($title) = $_->query('title');
my($summary) = $_->query('summary');
my($link) = $_->query('link/@href');
print $title->text_value."\n";
print $summary->text_value."\n";
print "$link\n\n";
}
DESCRIPTION
While the real strength of the Atom effort is the API and its unified format, retreiving feeds over HTTP and consuming their contents, similar like with RSS, will be a common use. The module endeavors to provide developers with a package that is simple, lightweight and easy install.
Development began with two primary goals:
- To create something simpler and more lightweight then using XML::Atom for the specific and common purpose of fetching Atom feeds.
- To see how quickly and easily I could cobble together such a package with existing modules.
The latter of these goals will be less of a focus going forward. That experiment has run its course. It went together quite easier and having developed the XML::RSS::Parser and XML::RAI modules, Atom data is much easier to process and use.
While keeping things simple was a priority, the XPath online interface may be a bit too spartan. Going forward, refining this interface so it is easier to work with will be a priority. (Feedback is appreciated.)
METHODS
- XML::Atom::Syndication->instance
-
Returns the XML::Atom::Syndication singleton.
- $instance->parse($text|IO_HANDLE)
-
Pass through to the
parse
method of the XML::Parser instance being used by the client. Returns the root XML::Atom::Syndication::Element object for the feed. - $instance->parse_file(FILE_HANDLE)
-
Pass through to the
parsefile
method of the XML::Parser instance being used by the client. Returns the root XML::Atom::Syndication::Element object for the feed. - $instance->get($url[,$file])
-
A method for fetching an Atom feed and parsing it. If an optional file name is provided, the method will mirror the feed to the file system location that is specified. Like the
parse
methods, returns the root XML::Atom::Syndication::Element object for the feed.
DEPENDENCIES
XML::Parser, XML::Parser::Style::Elemental, Class::XPath, LWP::Simple
SEE ALSO
XML::Atom::Syndication::Element, XML::Atom
AtomEnabled Alliance - http://www.atomenabled.org/
BUGS
Handling of unregistered XPath namespaces is incorrect.
TO DO
Refine the interface. Feedback appreciated.
Implement auto-discovery
find
method.Implement a means of passing through unescaped content markup if desired. (This would be helpful with unescaped content blocks.)
Implement registration of additional namespace prefixes
Implement means of LWP status/error reporting with
get
.Implement ETag support within
get
. (LWP::Simpleget
andmirror
only uses last-modified headers which are not always available with dynamic content.)
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::Atom::Syndication is Copyright 2004, Timothy Appnel, cpan@timaoutloud.org. All rights reserved.
6 POD Errors
The following errors were encountered while parsing the POD:
- Around line 61:
=begin without a target?
- Around line 118:
'=item' outside of any '=over'
- Around line 142:
You forgot a '=back' before '=head1'
- Around line 155:
'=item' outside of any '=over'
- Around line 157:
You forgot a '=back' before '=head1'
- Around line 192:
'=end' without a target?