It's been mentioned a few times, and there are some variations on the code. In a nutshell, it supports creating a feed from:
## just hashed data
{
xml_feed_attribute => 'value',
xml_feed_attribute => 'value',
xml_feed_attribute => 'value',
entries => [
xml_feed_item_attribute => 'value',
xml_feed_item_attribute => 'value',
xml_feed_item_attribute => 'value',
],
}
## objects with as_feed returning XML::Feed
$someobj->as_feed;
## objects with as_feed returning a hash
$someobj->as_feed( return {
xml_feed_attribute => 'value',
xml_feed_attribute => 'value',
xml_feed_attribute => 'value',
entries => [
xml_feed_item_attribute => 'value',
xml_feed_item_attribute => 'value',
xml_feed_item_attribute => 'value',
],
})
The entries key can also be an array of XML::Feed::Item objects, an
array of objects that return hashes or XML::Feed::Item from as_feed_item
methods.View::Feed::Atom and View::Feed::RSS simply use View::Feed and set the appropriate content-type.
Nothing fancy, but enough code to share an not have to rewrite again somewhere else.
If anyone thinks it's worth the effort, I'll kick out a dist this weekend. -=Chris
signature.asc
Description: OpenPGP digital signature
_______________________________________________ List: [email protected] Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/[email protected]/ Dev site: http://dev.catalyst.perl.org/
