Hi, all...
I used to use "feedtools" (now defunct) and I am trying to switch over
to the RSS stdlib.
Can anyone tell me why this doesn't work? (Error below)
Thanks,
Hal
require 'rss'
require 'open-uri'
URL = "http://feeds.space.com/SpacecomUniversalSpacePodcast"
rss = open(URL).read
feed = RSS::Parser.parse(rss)
puts "Description: #{feed.title}"
feed.items.each.with_index {|item,i| puts "#{i+1}. #{item.title}" }
Error is:
/Users/Hal/.rvm/rubies/ruby-2.0.0-p0/lib/ruby/2.0.0/rss/2.0.rb:53:in
`rescue in pubDate=': value <Thu, 05 July 2007 4:00:00 GMT> of tag
<pubDate> is not available. (RSS::NotAvailableValueError)
from /Users/Hal/.rvm/rubies/ruby-2.0.0-p0/lib/ruby/2.0.0/rss/2.0.rb:50:in
`pubDate='
from
/Users/Hal/.rvm/rubies/ruby-2.0.0-p0/lib/ruby/2.0.0/rss/parser.rb:456:in
`block in start_get_text_element'
from
/Users/Hal/.rvm/rubies/ruby-2.0.0-p0/lib/ruby/2.0.0/rss/parser.rb:358:in
`call'
from
/Users/Hal/.rvm/rubies/ruby-2.0.0-p0/lib/ruby/2.0.0/rss/parser.rb:358:in
`tag_end'
from
/Users/Hal/.rvm/rubies/ruby-2.0.0-p0/lib/ruby/2.0.0/rexml/parsers/streamparser.rb:26:in
`parse'
from
/Users/Hal/.rvm/rubies/ruby-2.0.0-p0/lib/ruby/2.0.0/rexml/document.rb:243:in
`parse_stream'
from
/Users/Hal/.rvm/rubies/ruby-2.0.0-p0/lib/ruby/2.0.0/rss/rexmlparser.rb:22:in
`_parse'
from
/Users/Hal/.rvm/rubies/ruby-2.0.0-p0/lib/ruby/2.0.0/rss/parser.rb:164:in
`parse'
from
/Users/Hal/.rvm/rubies/ruby-2.0.0-p0/lib/ruby/2.0.0/rss/parser.rb:79:in
`parse'