Created
September 23, 2016 20:53
-
-
Save drizzt/cf6ce23cb5421787892349b70d350830 to your computer and use it in GitHub Desktop.
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
require 'json' | |
require 'uri' | |
require 'net/http' | |
uri = URI('https://medium.com/@terremotocentroitalia/latest') | |
res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == 'https') do |http| | |
req = Net::HTTP::Get.new(uri, 'Accept' => 'application/json') | |
http.request(req) | |
end | |
j = JSON.load(res.body[16..-1]) | |
j['payload']['references']['Post'].each_value do |x| | |
puts x['title'] | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment