Last active
February 25, 2016 14:48
-
-
Save stevensona/a225621576a70c5e3a35 to your computer and use it in GitHub Desktop.
Consume RSS with Ruby
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rss' | |
require 'open-uri' | |
url = 'http://www.ruby-lang.org/en/feeds/news.rss' | |
open(url) do |rss| | |
feed = RSS::Parser.parse(rss) | |
puts "Title: #{feed.channel.title}" | |
feed.items.each do |item| | |
puts "Item: #{item.title}" | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment