Search code examples
rubyatom-feedfeedzirra

Feedzirra cannot parse atom feeds


The idea of having a single parser for any kind of feed is great and was hoping that it would work for me. I have been trying to get feedzirra to parse atom feeds. specifically:

  1. http://pindancing.blogspot.com/feeds/posts/default
  2. http://adam.heroku.com/feed

Those are just 2 that I tried with the problem is that feedzirra cannot parse the entry URL. It always comes out nil

feed = Feedzirra::Feed.fetch_and_parse(search.rss_feed_url)
p feed.entries.first.title
p feed.entries.first.url #=> returns nil

Is there anything I need to do to get it working?

thanks for your help


Solution

  • Hate to say "works for me", but, well, works for me:

    require 'Feedzirra'
    
    urls = %w{
      http://adam.heroku.com/feed
      http://pindancing.blogspot.com/feeds/posts/default
    }
    
    urls.each do |url|
      feed = Feedzirra::Feed.fetch_and_parse(url)
      puts feed.entries.first.title
      puts feed.entries.first.url
    end
    
    # => Memcached, a Database?
    # => http://adam.heroku.com/past/2010/7/19/memcached_a_database/
    # => The answer to "Will you mentor me?" is
    # => http://pindancing.blogspot.com/2010/12/answer-to-will-you-mentor-me-is.html 
    

    It'd help to see the rest of your code, particularly the actual parameter you're using in the fetch_and_parse method.