Here's the structure of the feed that I try to parse:
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" version="2.0">
<channel>
<title>
title..
</title>
<atom:link href="http://url/news/feed/" rel="self" type="application/rss+xml"/>
<link>http://url</link>
<description>
… description...
</description>
<lastBuildDate>Tue, 20 Nov 2012 14:37:30 +0000</lastBuildDate>
<language>sk-SK</language>
<sy:updatePeriod>hourly</sy:updatePeriod>
<sy:updateFrequency>1</sy:updateFrequency>
<generator>http://wordpress.org/?v=3.4.2</generator>
<item>
<title>title</title>
<link>
link
</link>
<comments>
link to comments
</comments>
<pubDate>Tue, 20 Nov 2012 13:29:05 +0000</pubDate>
<dc:creator>fcomp</dc:creator>
<category>
<![CDATA[ Novinky ]]>
</category>
<guid isPermaLink="false">http://url/?p=560</guid>
<description>
<![CDATA[
<p>text
]]>
<![CDATA[
text
]]>
</description>
<content:encoded>
<![CDATA[
text
]]>
</content:encoded>
<wfw:commentRss>
url
</wfw:commentRss>
<slash:comments>0</slash:comments>
</item>
...
And how I parse it:
def rss_feed
feed = Feedzirra::Feed.fetch_and_parse("http://url/news/feed/")
feed.entries.each do |entry|
puts entry.inspect
end
end
This code worked me pretty long time, but now I checked the output from this snippet and the output is:
undefined method `entries' for nil:NilClass
I have no idea, why suddenly the code doesn't work, the RSS has still the same output.
Is this a bug in the Feedzirra
or where could be a problem?
Eventually, is there any good alternative to Feedzirra
gem? I have read that the similar issue have more developers, but I didn't find a cause of the error message...