您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Get the location in any GeoGuessr-alike game
// ==UserScript== // @name AnyGuessr - Universal Geoguessr-alike game cheat // @namespace http://tampermonkey.net/ // @version 1.1 // @description Get the location in any GeoGuessr-alike game // @author daijro // @license MIT // @include * // @icon https://www.google.com/s2/favicons?sz=64&domain=geoguessr.com // @grant GM_xmlhttpRequest // ==/UserScript== let globalCoordinates = { lat: 0, lng: 0 }; let globalPanoID = undefined; // Function to fetch the country name using Nominatim API (OpenStreetMap) async function findCountry({ lat, lon }) { let data = null; try { const response = await fetch(`https://nominatim.openstreetmap.org/reverse?lat=${lat}&lon=${lon}&format=json`); data = await response.json(); } catch (e) { console.error("Error fetching country data:", e); data = { address: { country: "Unknown" }}; // default to unknown if error occurs } return data?.address?.country ?? "Unknown"; } // Override XMLHttpRequest open to intercept API calls and extract coordinates var originalOpen = XMLHttpRequest.prototype.open; XMLHttpRequest.prototype.open = function(method, url) { if (method.toUpperCase() === 'POST' && (url.startsWith('https://maps.googleapis.com/$rpc/google.internal.maps.mapsjs.v1.MapsJsInternalService/GetMetadata') || url.startsWith('https://maps.googleapis.com/$rpc/google.internal.maps.mapsjs.v1.MapsJsInternalService/SingleImageSearch'))) { this.addEventListener('load', async function () { let interceptedResult = this.responseText; const pattern = /-?\d+\.\d+,-?\d+\.\d+/g; let match = interceptedResult.match(pattern)[0]; let split = match.split(","); let lat = Number.parseFloat(split[0]); let lng = Number.parseFloat(split[1]); globalCoordinates.lat = lat; globalCoordinates.lng = lng; console.log(`Coordinates: ${JSON.stringify(globalCoordinates)}`); // Call function to fetch country name const country = await findCountry({ lat, lon: lng }); console.log(`Detected Country: ${country}`); }); } return originalOpen.apply(this, arguments); };
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址