Paste: Http
Author: | Hello |
Mode: | lua |
Date: | Tue, 4 Dec 2012 10:24:07 |
Plain Text |
require('md5')
require('json')
require("socket.http")
local api_url = 'http://yilmazugurlu.me/static/js/api.json'
local app_id = 'final12439812'
local api_key = md5.sumhexa(app_id .. os.date('%Y-%m-%d'))
local requrest_url = string.format('%s?key=%s', api_url, api_key)
response, header_code, headers, response_code = socket.http.request(requrest_url)
response = json.decode(response)
for i,v in ipairs(response) do
print (string.format('%s: %s - %s / %s TL.', v.id, v.kitap_adi, v.yazar_adi, v.fiyati))
end
New Annotation