NAME

AmphetaDesk::Channels.pm - Parses and returns our syndicated feeds.

SYNOPSIS

     $channel_object = load_channel( $channel_xml, $channel_url );

DESCRIPTION

This package contains all the various functions that read our different flavors of RSS or scriptingNews. It's pretty crucial to happy operation. It uses XML::Simple (benchmarked as being about three times faster than XML::RSS) to do pretty much everything, and returns a parsed tree similar to RSS 1.0 (regardless of what format was actually parsed).

If an error occurs during the channel loading, we fake an RSS 1.0 tree with a single item: that of the error message. It's cheap, it's not ideal, but hey, it works fluidly, so there are no plans to change it.

METHODS

load_channel($channel_xml, $channel_url)
This routine looks at $channel_xml, determines if it's a filename or just plain xml, and returns a common data structure, regardless of the underlying xml spec. It'll also modify all internal links to user preference via AmphetaDesk::Utilities::add_link_targets.
Currently supported formats include all RSS, and scriptingNews.
This routine can also accept, as a second optional argument, the XML URL of the $channel_xml. If this is passed, it's used to correlate the $channel_xml with a "My Channels" subscription (determined by the URL). This allows us to update our subscription information with any new data received from a good parse (with AmphetaDesk::MyChannels's update_my_channel_data).
load_channel returns a $data structure that closely represents an RSS 1.0 tree, regardless of what syndication format was actually parsed. You can examine the tree by using Data::Dumper.

SEE ALSO

AUTHOR

Morbus Iff, <morbus@disobey.com>

COPYRIGHT AND LICENSE

Copyright 2000-2004 Morbus Iff <morbus@disobey.com>

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.