Hi all,
Using the default Ruby RSS parser, which format is best suited to
pulling in images from feed elements, RSS2 or Atom?
And then, how do I use the RSS classes to pull those images, per feed
element? I am not finding examples, and the api is a bit baroque.
If it matters, I’m pulling RSS from Wordpress, of which I also have
admin access (can even change/set plugins).
Thank you!
Chris G.
Thanks for the reply back.
‘channel’, I believe, is a wrapper for items. So the code just seems to
pull back the logo for the feed, not individual item images.
Let me paste in a snippet of RSS:
Watering Holes: Memphis At the Santora
http://daily.likeme.net/?p=184
<![CDATA[The SanTana outpost...
]]>
<![CDATA[
The SanTana outpost...]]>
Wordpress uses content:encoded to store the media referenced in the
item.
Is there a ruby way of getting to content:encoded?
Or does anyone know a way to force Wordpress to output better RSS?
Thanks again,
Chris
Hi,
In [email protected]
“Re: RSS and images” on Tue, 5 Jan 2010 03:18:25 +0900,
Christopher G. [email protected] wrote:
‘channel’, I believe, is a wrapper for items. So the code just seems to
pull back the logo for the feed, not individual item images.
‘channel’ is for not .
item.
Is there a ruby way of getting to content:encoded?
rss20 = RSS::Parser.parse(rss20_xml)
rss20.items.each do |item|
puts item.content_encoded
end
Thanks,
Hi,
In [email protected]
“RSS and images” on Mon, 4 Jan 2010 08:20:15 +0900,
Christopher G. [email protected] wrote:
Using the default Ruby RSS parser, which format is best suited to
pulling in images from feed elements, RSS2 or Atom?
And then, how do I use the RSS classes to pull those images, per feed
element? I am not finding examples, and the api is a bit baroque.
rss20 = RSS::Parser.parse(rss20_xml)
image = rss20.channel.image
puts image.url if image and image.url
atom = RSS::Parser.parse(atom_xml)
logo = atom.feed.logo
puts logo.content if logo and logo.content
Thanks,