RSS to JSON API : Ruby example


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

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

http = Net::HTTP.new(url.host, url.port)

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

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



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

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