From 123e09306bc6b0a8b19dd03cd627c7ee2b672032 Mon Sep 17 00:00:00 2001 From: choelzl Date: Wed, 9 Feb 2022 03:12:09 +0100 Subject: [PATCH] WIP --- twitch/chatguessr.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/twitch/chatguessr.js b/twitch/chatguessr.js index 467b809..830229b 100644 --- a/twitch/chatguessr.js +++ b/twitch/chatguessr.js @@ -1,13 +1,10 @@ - - - (function() { - const BDC_KEY = "067c718d2bbd4a2ba8d0645e1633cac2"; - var HttpRequest = Packages.com.gmt2001.HttpRequest, - JSONObject = Packages.org.json.JSONObject; + async function fetchSeed(id) { + var HttpRequest = Packages.com.gmt2001.HttpRequest, + JSONObject = Packages.org.json.JSONObject; let request = HttpRequest.getData(HttpRequest.RequestType.GET,`https://www.geoguessr.com/api/v3/games/${id}`,{},{}); if (request.success) { var data = new JSONObject(request.content) @@ -15,6 +12,9 @@ } }; async function getCountryBDC(location) { + var HttpRequest = Packages.com.gmt2001.HttpRequest, + JSONObject = Packages.org.json.JSONObject; + 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}`,{},{}); if (request.success) { var data = new JSONObject(request.content)