WIP
This commit is contained in:
parent
f66eb64998
commit
4c91662ec8
@ -4,8 +4,11 @@
|
||||
|
||||
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}`,{},{});
|
||||
HashMap = Packages.java.util.HashMap,
|
||||
JSONObject = Packages.org.json.JSONObject
|
||||
header = new HashMap(0),
|
||||
json = new JSONObject('{}');
|
||||
let request = HttpRequest.getData(HttpRequest.RequestType.GET,`https://www.geoguessr.com/api/v3/games/${id}`,json.toString(),header);
|
||||
if (request.success) {
|
||||
var data = new JSONObject(request.content)
|
||||
return data;
|
||||
@ -13,14 +16,16 @@
|
||||
};
|
||||
function getCountryBDC(location) {
|
||||
var HttpRequest = Packages.com.gmt2001.HttpRequest,
|
||||
JSONObject = Packages.org.json.JSONObject;
|
||||
HashMap = Packages.java.util.HashMap,
|
||||
JSONObject = Packages.org.json.JSONObject
|
||||
header = new HashMap(0),
|
||||
json = new 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}`,{},{});
|
||||
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);
|
||||
if (request.success) {
|
||||
var data = new JSONObject(request.content)
|
||||
return data.countryCode;
|
||||
}
|
||||
|
||||
};
|
||||
function getSurroundings (location) {
|
||||
const meters = 100;
|
||||
|
Loading…
x
Reference in New Issue
Block a user