This commit is contained in:
choelzl 2022-02-09 03:19:16 +01:00
parent d06fcb7ae2
commit 108fdac4e0
Signed by: sora
GPG Key ID: A362EA0491E2EEA0

View File

@ -8,7 +8,7 @@
JSONObject = Packages.org.json.JSONObject, JSONObject = Packages.org.json.JSONObject,
header = new HashMap(0), header = new HashMap(0),
json = new JSONObject('{}'); json = new JSONObject('{}');
let request = HttpRequest.getData(HttpRequest.RequestType.GET,`https://www.geoguessr.com/api/v3/games/${id}`,json.toString(),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 data; return data;
@ -21,7 +21,7 @@
header = new HashMap(0), header = new HashMap(0),
json = new JSONObject('{}'); json = new JSONObject('{}');
const BDC_KEY = "067c718d2bbd4a2ba8d0645e1633cac2"; const BDC_KEY = "067c718d2bbd4a2ba8d0645e1633cac2";
let request = HttpRequest.getData(HttpRequest.RequestType.GET,`https://api.bigdatacloud.net/data/reverse-geocode?latitude=${location.lat}&longitude=${location.lng}&key=${BDC_KEY}`,json.toString(),header); var request = HttpRequest.getData(HttpRequest.RequestType.GET,'https://api.bigdatacloud.net/data/reverse-geocode?latitude='+location.lat+'&longitude='+location.lng+'&key='+BDC_KEY,json.toString(),header);
if (request.success) { if (request.success) {
var data = new JSONObject(request.content) var data = new JSONObject(request.content)
return data.countryCode; return data.countryCode;