Update 'twitch/chatguessr.js'

This commit is contained in:
sora 2022-04-23 21:09:38 +02:00
parent 1fbe40143a
commit 0e840d827d

View File

@ -4,14 +4,12 @@
var HttpRequest = Packages.com.gmt2001.HttpRequest, var HttpRequest = Packages.com.gmt2001.HttpRequest,
HashMap = Packages.java.util.HashMap, HashMap = Packages.java.util.HashMap,
JSONObject = Packages.org.json.JSONObject, JSONObject = Packages.org.json.JSONObject,
header = new HashMap(0), header = new HashMap(0);
json = new JSONObject('{}'); var request = HttpRequest.getData(HttpRequest.RequestType.GET,'https://www.geoguessr.com/api/v3/games/'+id,'',header);
var request = HttpRequest.getData(HttpRequest.RequestType.GET,'https://www.geoguessr.com/api/v3/games/'+id,json.toString(),header);
if (request.success) { if (request.success) {
var data = new JSONObject(request.content) var data = new JSONObject(request.content)
return JSON.parse(data); return JSON.parse(data);
} }
return {};
}; };
function getCountryBDC(location) { function getCountryBDC(location) {