This commit is contained in:
choelzl 2022-02-09 03:12:09 +01:00
parent 977f012ba4
commit 123e09306b
Signed by: sora
GPG Key ID: A362EA0491E2EEA0

View File

@ -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)