Geogussr Location Resolver

Find your location in Geoguessr!

اعتبارا من 28-08-2022. شاهد أحدث إصدار.

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

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

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

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

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

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

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.

ستحتاج إلى تثبيت إضافة مثل Stylus لتثبيت هذا النمط.

ستحتاج إلى تثبيت إضافة لإدارة أنماط المستخدم لتتمكن من تثبيت هذا النمط.

ستحتاج إلى تثبيت إضافة لإدارة أنماط المستخدم لتثبيت هذا النمط.

ستحتاج إلى تثبيت إضافة لإدارة أنماط المستخدم لتثبيت هذا النمط.

(لدي بالفعل مثبت أنماط للمستخدم، دعني أقم بتثبيته!)

// ==UserScript==
// @name         Geogussr Location Resolver
// @namespace    http://tampermonkey.net/
// @version      3.0
// @description  Find your location in Geoguessr!
// @author       0X69ED75
// @match        https://www.geoguessr.com/*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=geoguessr.com
// @grant        none
// ==/UserScript==

let grab = (element) => {
    let x = document.getElementsByClassName(element)[0]
    let y = x.textContent.trim();
    let z = Object.keys(x)
    let a = z.find(g => g.startsWith("__reactFiber$"))
    let b = x[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 o = () =>{
    if((document.getElementsByClassName("game_panorama__3IFKG")[0]) !== undefined){
        grab("game_panorama__3IFKG")
    }
    else if(document.getElementsByClassName("game-layout__panorama-canvas")[0] !== undefined){
        grab("game-layout__panorama")
    }
    else if(document.getElementsByClassName("game-panorama_panorama__rdhFg")[0] !== undefined){
       grab("game-panorama_panorama__rdhFg")
    }
    else{alert("Unable to find Location, please try another gamemode.")}
}


let l = (e) => {
    if(e.keyCode === 86){o()}
    }


    document.addEventListener("keydown", l);