
XML::Atom::Syndication - a simple lightweight client for consuming Atom syndication feeds.

#!/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')) {
print $_->query('title')->text_value."\n";
print $_->query('summary')->text_value."\n";
print $_->query('link/@href')."\n\n";
}
XML::Atom::Syndication->xpath_namespace('tima','http://www.timaoutloud.org/');
print XML::Atom::Syndication->xpath_namespace('http://www.timaoutloud.org/')."\n";
print XML::Atom::Syndication->xpath_namespace('tima')."\n";

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:
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.)
This interface is still somewhat in flux and is subject to change.

Returns the XML::Atom::Syndication singleton.
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.
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.
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.
A class method accessor to the XPath namespace mappings. XPath query namespaces declarations are independant of the document it is querying. By default this module contains the followiing declarations:
(default/no prefix) http://purl.org/atom/ns# dc http://purl.org/dc/elements/1.1/ dcterms http://purl.org/dc/terms/ sy http://purl.org/rss/1.0/modules/syndication/ trackback http://madskills.com/public/xml/rss/module/trackback/ xhtml http://www.w3.org/1999/xhtml/ xml http://www.w3.org/XML/1998/namespace/
To add or modify a mapping, call this method with the prefix and then URI to be registered. To lookup the associated URI of a prefix just pass in the prefix string. If a URI is passed in then the associated prefix is returned. In either case undef will be returned if no value has been set.

XML::Parser, XML::Parser::Style::Elemental, Class::XPath, LWP::Simple

XML::Atom::Syndication::Document, XML::Atom::Syndication::Element, XML::Atom::Syndication::Characters, XML::Atom
AtomEnabled Alliance - http://www.atomenabled.org/
atom-syntax mailing list - http://www.imc.org/atom-syntax/

LWP::Simple::mirror call in get fails.
find method.get.get. LWP::Simple mirror only uses last-modified headers which are not always available with dynamic content.
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.

Except where otherwise noted, XML::Atom::Syndication is Copyright 2004, Timothy Appnel, cpan@timaoutloud.org. All rights reserved.