Created
August 8, 2018 21:01
-
-
Save nafidurmus/61492f6e2fa19e368212d2a0e87aa83d 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
def index | |
require ‘uri’ | |
require ‘net/http’ | |
url = URI(“https://api.hurriyet.com.tr/v1/articles?$top=20") | |
http = Net::HTTP.new(url.host, url.port) | |
http.use_ssl = true | |
http.verify_mode = OpenSSL::SSL::VERIFY_NONE | |
request = Net::HTTP::Get.new(url) | |
request[“apikey”] = ‘kendi apikeyinizi buraya yapıştırın’ | |
request[“accept”] = ‘application/json’ | |
@response = http.request(request) | |
@hurriyet = JSON.parse(@response.body) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment