Results 1 to 4 of 4
Thread: Reading an RSS 2 feed with Ruby
Jan 10, 2007, 02:21 #1
- Join Date
- Oct 2006
- San Francisco, CA
- 0 Post(s)
- 0 Thread(s)
Reading an RSS 2 feed with Ruby
So I'm trying to use RSS:Parse to read in a RSS file from flickr
here's my current code. The problems is elements under item that are like "media:category"
how do I call these elements, and how do I get attributes of elements as well .
Here's my current code (not final, just trying to get it working before I prettify), which works if I take out the the item.media:category line
unless photostream.tags.blank? and flickruser.nil? open(flickr_RSS_uri) do |http| response = http.read result = RSS::Parser.parse(response, false) result.items.each_with_index do |item, i| %> <%=item.link%> <%=item.title%> <%=item.media:category%> <% end end end