diff options
Diffstat (limited to 'lib/Crawl/Bot/Role/RSS.pm')
-rw-r--r-- | lib/Crawl/Bot/Role/RSS.pm | 10 |
1 files changed, 9 insertions, 1 deletions
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; |