Quantcast
Viewing latest article 11
Browse Latest Browse All 47

Atom/RSS feed reading doesn't show all nodes [Found-and-Closed]

I have the following RSS feed. When I parse this feed using Feedzira, Simple-rss and by RSS Parser one by one, I faced similar problem that for item nodes in this RSS, It is just showing title and description, but skipping url and id nodes.

<rss xmlns:content="![CDATA[http://purl.org/rss/1.0/modules/content/]]" version="2.0">
<parsererror style="display: block; white-space: pre; border: 2px solid #c77; padding: 0 1em 0 1em; margin: 1em; background-color: #fdd; color: black">
<h3>This page contains the following errors:</h3>
<div style="font-family:monospace;font-size:12px">
error on line 1 at column 63: xmlns:content: '![CDATA[http://purl.org/rss/1.0/modules/content/]]' is not a valid URI
</div>
<h3>
Below is a rendering of the page up to the first error.
</h3>
</parsererror>
<channel>
<title>
<![CDATA[ Leonardo Hotels ]]>
</title>
<link>
<![CDATA[ http://www.leonardo-hotels.mobi ]]>
</link>
<description>
<![CDATA[ All Leonardo Hotels ]]>
</description>
<copyright>
<![CDATA[ Copyright 2013, Silvertravel.co.il ]]>
</copyright>
<ttl>20</ttl>
<lastBuildDate>
<![CDATA[ Thu, 21 Nov 2013 11:34:38 EST ]]>
</lastBuildDate>
<item>
<content:lang>
<![CDATA[ eng ]]>
</content:lang>
<content:id>
<![CDATA[ 16 ]]>
</content:id>
<title>
<![CDATA[ Leonardo Suite Hotel Tel Aviv-Bat Yam ]]>
</title>
<description>
<![CDATA[
Located directly at the beach, the Leonardo Suite Hotel Tel Aviv-Bat Yam offers 108 ]]>
</description>
<content:url>
<![CDATA[
http://www.leonardo-hotels.mobi/octopus/Upload/Images/Resorts/batyam deluxe livingroom 255.jpg
]]>
</content:url>
</item>
.
.
.
<item> ...</item>
<item> ...</item>

For more insight of this problem this is the code for each parser:

For RSS parser

url = 'http://www.leonardo-hotels.mobi/rss.aspx?lang=eng'
url, timeout =  feed_url.strip, 60
uri = URI.parse(URI.encode(url))
http = Net::HTTP.new(uri.host, uri.port)
http.open_timeout, http.read_timeout = timeout, timeout
http.request_get(uri.request_uri) do |response|
  data = RSS::Parser.parse(response.read_body, false, false)
    puts data.channel.item.inspect
    return data.channel.items
end

For Simple RSS

url = 'http://www.leonardo-hotels.mobi/rss.aspx?lang=eng'
rss = SimpleRSS.parse open(url)
puts rss.channel.items.first

For Feedzira

url = 'http://www.leonardo-hotels.mobi/rss.aspx?lang=eng'
rss = Feedzirra::Feed.fetch_and_parse(url)
puts rss.entries.first.inspect

The problem is that it is not showing all nodes children data.


Viewing latest article 11
Browse Latest Browse All 47

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>