On 5 Apr, 01:29, Kouhei Sutou <k...@cozmixng.org> wrote:
> Please show an example.
Sorry, I got tangled up in my own wishes. My problem with the library
was just in my head. I suppose I was just hoping for a more consistent
representation of a feed than I've had to deal with in the past. I
know that what is generated by RSS/ATOM parsing libraries is a
reflection of the feeds themselves.
Anyway, a few examples of what bugs me, demonstrated in irb:
require 'rss'
rss = 'http://www.giftedslacker.com/feed/'
atom = 'http://oblivionation.blogspot.com/feeds/posts/default'
rssfeed = RSS:

arser.parse(rss)
atomfeed = RSS:

arser.parse(atom)
#print the content of the most recent post
puts rssfeed.items[0].content_encoded
puts atomfeed.items[0].content.content
#print the titles of the posts in the feed
rssfeed.items.each {|item| puts item.title}
atomfeed.items.each {|item| puts item.title.content}
#print the author of the most recent post
rssfeed.items[0].dc_creator
atomfeed.entries[0].author.name.content
---
What I'd like is a consistent interface to the commonly used elements
in ATOM and RSS feeds, regardless of version. It must be more
difficult than it seems to me, because I'm not aware that anyone does
it. I might give it a try just for fun. But, being new to Ruby, I'm
not sure where to begin.
-grant