Skip to content

Instantly share code, notes, and snippets.

@ywjno
Created May 9, 2012 07:41
Show Gist options
  • Save ywjno/2642732 to your computer and use it in GitHub Desktop.
Save ywjno/2642732 to your computer and use it in GitHub Desktop.
read rss content used ruby
# 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