AmphetaDesk::Channels.pm - Parses and returns our syndicated feeds.
$channel_object = load_channel( $channel_xml, $channel_url );
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.
load_channel($channel_xml, $channel_url)
$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.$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.Morbus Iff, <morbus@disobey.com>
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.