RSS to JSON API : Ruby example


require 'uri'
require 'net/http'
require 'json'

uri = URI("https://api.rss2json.com/v1/api.json?rss_url=https%3A%2F%2Fnews.ycombinator.com%2Frss")

http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true

request = Net::HTTP::Get.new(uri)

response = http.request(request)
data = JSON.parse(response.read_body)



puts "====== #{data['feed']['title']} ======"

data['items'].each {|item| puts item['title']}