Reputation: 6542
In my sample project, I am trying to read one new ress feed and I am using most popular gem 'feedjira'
but I am not able to fetch the values. I tried simple-rss
gem as well.
Still no progress.
user@localhost ~]$ irb
2.1.2 :001 > urls = %w[http://feedjira.com/blog/feed.xml https://github.com/feedjira/feedjira/feed.xml]
=> ["http://feedjira.com/blog/feed.xml", "https://github.com/feedjira/feedjira/feed.xml"]
2.1.2 :002 > feeds = Feedjira::Feed.fetch_and_parse urls # returns a Hash, with each url having a Feedjira::Feed object
NameError: uninitialized constant Feedjira
from (irb):2
from /home/user/.rvm/rubies/ruby-2.1.2/bin/irb:11:in `<main>'
Please have a look and suggest something.
Upvotes: 0
Views: 808
Reputation: 6542
After a googling, I found one script related to fetching the RSS feed. Working fine but some times it reply the output and some times 401 as status code.
Not sure what is the reason and still investigating.
require 'feedjira'
feed_parsed = Feedjira::Feed.fetch_and_parse("https://news.yahoo.com/rss/topstories",
{:ssl_verify_peer => false})
puts feed_parsed
Upvotes: 0