RSS::Parser not showing <content:encoded> tags

L

lists

Hi,
I'm playing around with lib/rss and am having difficulty getting the
<content:encoded> tags. Here's what I mean:

###
require 'rss/2.0'
require 'rss/content'
require 'open-uri'

feed = 'http://docs.info.apple.com/rss/allproducts.rss'

open(feed) { |http|
rss = RSS::parser.parse(http.read, false)
p rss.items[1]
}
###

The above code shows this:

#<RSS::Rss::Channel::Item:0x6bce08 @pubDate=Fri Nov 04 13:54:02 CST
2005, @link="http://docs.info.apple.com/article.html?artnum=61798",
@do_validate=false, @guid=nil, @comments=nil, @category=[],
@author=nil, @description="Release date: Fri, 4 Nov 2005 13:54:02
-0600", @enclosure=nil, @title="Apple security updates",
@converter=nil, @source=nil>

Note that @content is missing. If I curl http://docs.info.apple.com/
rss/allproducts.rss I see that there are <content:encoded> tags. Any
ideas what I need to do to be able to get @content in the
RSS::Rss::Channel::Item object?

Thanks,
Ryan
 
K

Kouhei Sutou

Hi,

In <[email protected]>
"RSS::parser not showing <content:encoded> tags" on Sat, 5 Nov 2005 12:26:22 +0900,
lists said:
I'm playing around with lib/rss and am having difficulty getting the
<content:encoded> tags. Here's what I mean:

Sorry, RSS Parser doesn't support RSS 2.0 with content
module. Because I can't find the specification of RSS 2.0
with content module.
Any
ideas what I need to do to be able to get @content in the
RSS::Rss::Channel::Item object?

The followiong code will help you:
###
require 'rss/2.0'
require 'rss/content'
require 'open-uri'

module RSS
class Rss
install_ns(CONTENT_PREFIX, CONTENT_URI)
class Channel
class Item; include ContentModel; end
end
end
end
feed = 'http://docs.info.apple.com/rss/allproducts.rss'

open(feed) { |http|
rss = RSS::parser.parse(http.read, false)
p rss.items[1]
}
###


Thanks,
 
L

lists

module RSS
class Rss
install_ns(CONTENT_PREFIX, CONTENT_URI)
class Channel
class Item; include ContentModel; end
end
end
end

That's just what I needed, thanks!

-Ryan
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,043
Latest member
CannalabsCBDReview

Latest Threads

Top