Created
May 9, 2012 07:41
-
-
Save ywjno/2642732 to your computer and use it in GitHub Desktop.
read rss content used 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
# encoding: utf-8 | |
require 'rss' | |
require 'open-uri' | |
# url or local file | |
source = "http://snippets.aktagon.com/main.rss" | |
# and ths src when if url is https | |
require 'openssl' | |
OpenSSL::SSL::VERIFY_PEER = OpenSSL::SSL::VERIFY_NONE | |
# raw content of rss feed | |
content = "" | |
open(source) do |s| content = s.read end | |
rss = RSS::Parser.parse(content, false) | |
puts rss.channel.items |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment