Thank you, i success to use http.requet to get high score from Facebook Graph API. But i have a problem, when first time i request score, its successfully but in second time I request, its error
FATAL:DLIB: ETag mismatch ("981ebe231dbb462cec0347f71aaafc757ac4ce38" vs ) ERROR:SCRIPT: HTTP request to 'https://graph.facebook.com/v2.5/me/scores?access_token=CAAIZAM7tgTYgBAFXUxoUZBfAnGOsRu55O4QgsrLNhY8GUDYR9CIZBlHIcOQcqMjs1aZCuD34N4ZAZCpvT2w907UWCM5h5wB7GsPOX52ZAURDyB2BlU25tD5k0JlNZBwGQbggkLc4kr7eJ61cR1sgJ2btXsMOoO21sPlszpgb5MZCwXevlrXXseTgeNRFZAwYuKXy4ZD' failed (http result: -8 socket result: 0) DEBUG:SCRIPT: 0 DEBUG:SCRIPT: DEBUG:SCRIPT: { expires = Sat, 01 Jan 2000 00:00:00 GMT, content-type = text/javascript; charset=UTF-8, connection = keep-alive, content-length = 0, access-control-allow-origin = *, pragma = no-cache, x-fb-debug = JQD41MeNlCzH9dh+I/ezr8oB1bTDywfF2L25NcnZzchujXV4PMCWJI4r+kOjEy82OgNZ9SKpyNnucPLpAfEVeA==, facebook-api-version = v2.5, date = Fri, 08 Apr 2016 10:16:43 GMT, cache-control = private, no-cache, no-store, must-revalidate, x-fb-rev = 2274481, x-fb-trace-id = DtH4V+9DuTN, }
My code
`local function http_result(self, id, response)
print(response.status)
print(response.response)
pprint(response.headers)
pprint(facebook.access_token())
if response.status == 200 then
local dta = json.decode(response.response)
pprint(dta)
gui.set_text(self.face_node, dta.data[1].score)
else
gui.set_text(self.face_node, “Error: “…response.status…”(”…facebook.me().name…")")
facebook.logout()
end
end
local function fb_score(self)
–pprint("access token "…facebook.access_token())
http.request(“https://graph.facebook.com/v2.5/me/scores?access_token=”…facebook.access_token(), “GET”, http_result)
end`