Fix for issue #5 - RSS 'item' is a hash instead of a list

This commit is contained in:
Brian Ó Donnell
2016-04-15 08:07:00 -04:00
parent ec77844008
commit 32879b515d
+6 -1
View File
@@ -377,8 +377,13 @@ sub decode_feed{
my @list = ();
# RSS
if( defined $feed->{'channel'} and defined $feed->{'channel'}->{'item'} and ref $feed->{'channel'}->{'item'} eq 'ARRAY' ){
if( defined $feed->{'channel'} and defined $feed->{'channel'}->{'item'} ){
if( ref $feed->{'channel'}->{'item'} eq 'ARRAY' ){
@list = @{$feed->{'channel'}->{'item'}};
}
elsif( ref $feed->{'channel'}->{'item'} eq 'HASH' ){
@list = values %{$feed->{'channel'}->{'item'}};
}
}
# Atom
elsif( defined $feed->{'entry'} and ref $feed->{'entry'} eq 'HASH' ){