Geogussr Resolver

A Geogussr location resolver.

Stan na 26-08-2022. Zobacz najnowsza wersja.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Greasemonkey lub Violentmonkey.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana będzie instalacja rozszerzenia Tampermonkey lub Userscripts.

You will need to install an extension such as Tampermonkey to install this script.

Aby zainstalować ten skrypt, musisz zainstalować rozszerzenie menedżera skryptów użytkownika.

(Mam już menedżera skryptów użytkownika, pozwól mi to zainstalować!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Musisz zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

(Mam już menedżera stylów użytkownika, pozwól mi to zainstalować!)

// ==UserScript==
// @name         Geogussr Resolver
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  A Geogussr location resolver.
// @author       0X69ED75
// @match        https://www.geoguessr.com/*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=geoguessr.com
// @grant        none
// ==/UserScript==

let Grab = () => {
    let x = document.getElementsByClassName("game-layout__panorama")[0] 
    let y = document.getElementsByClassName("game-layout__panorama-canvas")[0].textContent.trim();
    let z = Object.keys(x)
    let a = z.find(g => g.startsWith("__reactFiber$"))
    let b = document.getElementsByClassName("game-layout__panorama")[0][a].child.memoizedProps.children.props 
    let c = b.lat
    let d = b.lng

    getAddress(c,d).then(f => {
            alert(`
    Country: ${f.address.country}
    County: ${f.address.county}
    Road: ${f.address.road}
    State: ${f.address.state}
    Latitude: ${c}
    Longitude: ${d}
    `) } );

}

let getAddress = async(e,w) => {
    let response = await fetch(`https://nominatim.openstreetmap.org/reverse?lat=${e}&lon=${w}&format=json`)
    let data = await response.json()
    return data;
}



let onKeyDown = (e) => {
    if(e.keyCode === 86){Grab()}
    }


    document.addEventListener("keydown", onKeyDown);