Geogussr Location Resolver

Find out where you are in Geoguessr!

当前为 2022-08-28 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name Geogussr Location Resolver
  3. // @namespace http://tampermonkey.net/
  4. // @version 2.01
  5. // @description Find out where you are in Geoguessr!
  6. // @author 0X69ED75
  7. // @match https://www.geoguessr.com/*
  8. // @icon https://www.google.com/s2/favicons?sz=64&domain=geoguessr.com
  9. // @grant none
  10. // ==/UserScript==
  11.  
  12. let grab = (element) => {
  13. let x = document.getElementsByClassName("game-layout__panorama")[0]
  14. let y = x.textContent.trim();
  15. let z = Object.keys(x)
  16. let a = z.find(g => g.startsWith("__reactFiber$"))
  17. let b = x[a].child.memoizedProps.children.props
  18. let c = b.lat
  19. let d = b.lng
  20.  
  21. getAddress(c,d).then(f => {
  22. alert(`
  23. Country: ${f.address.country}
  24. County: ${f.address.county}
  25. Road: ${f.address.road}
  26. State: ${f.address.state}
  27. Latitude: ${c}
  28. Longitude: ${d}
  29. `) } );
  30.  
  31. }
  32.  
  33. let getAddress = async(e,w) => {
  34. let response = await fetch(`https://nominatim.openstreetmap.org/reverse?lat=${e}&lon=${w}&format=json`)
  35. let data = await response.json()
  36. return data;
  37. }
  38.  
  39. let o = () =>{
  40. if((document.getElementsByClassName("game_panorama__3IFKG")[0]) !== undefined){
  41. grab("game_panorama__3IFKG")
  42. }
  43. else if(document.getElementsByClassName("game-layout__panorama-canvas")[0] !== undefined){
  44. grab("game-layout__panorama")
  45. }
  46. else{alert("Unable to find Location, please try another gamemode.")}
  47.  
  48. }
  49.  
  50.  
  51. let l = (e) => {
  52. if(e.keyCode === 86){o()}
  53. }
  54.  
  55.  
  56. document.addEventListener("keydown", l);

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址