From 6f14c0b2c354d81be4be7132c574cc474e4d5e2c Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Mon, 30 Nov 2009 21:12:42 -0600 Subject: XML::RAI is dumb --- lib/Crawl/Bot/Role/RSS.pm | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'lib/Crawl/Bot/Role') diff --git a/lib/Crawl/Bot/Role/RSS.pm b/lib/Crawl/Bot/Role/RSS.pm index 8470eee..8576a82 100644 --- a/lib/Crawl/Bot/Role/RSS.pm +++ b/lib/Crawl/Bot/Role/RSS.pm @@ -10,7 +10,15 @@ requires 'rss_feed'; sub current_items { my $self = shift; my $rss = XML::RAI->parse_uri($self->rss_feed); - return @{ $rss->items }; + # after the XML::RAI object goes out of scope, the item objects become + # worthless. how dumb. capture the relevant data in some hashrefs instead. + return map { + my $item = $_; + +{ + map { $_ => $item->$_ } + qw(identifier title link creator) + } + } @{ $rss->items }; } no Moose::Role; -- cgit v1.2.3-54-g00ecf