Skip to content

Instantly share code, notes, and snippets.

@ice2heart
Last active June 23, 2018 08:15
Show Gist options
  • Save ice2heart/9889888 to your computer and use it in GitHub Desktop.
Save ice2heart/9889888 to your computer and use it in GitHub Desktop.
require 'rss/2.0'
require 'cgi'
require 'net/http'
host = Net::HTTP.new('bash.im', 443)
host.use_ssl = true
resp = host.get('https://bash.im/rss/')
data = resp.body
parsed = RSS::Parser.parse(data.gsub(/\<hr\>/, '<hr/>'), false)
parsed.items.each { |x| puts CGI::unescapeHTML(x.description.gsub("\n", "").gsub("<br>", "\n")); puts "%\n" }
@MeDVen
Copy link

MeDVen commented Jan 14, 2016

Thanks! It's work!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment