Antipoder

Takes your GeoGuessr guess and flips it to the antipode

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

Advertisement:

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

Advertisement:

// ==UserScript==
// @name         Antipoder
// @description  Takes your GeoGuessr guess and flips it to the antipode
// @license      MIT
// @namespace    http://tampermonkey.net/
// @version      2026-05-09
// @match        *://*.geoguessr.com/*
// @run-at       document-start
// @grant        unsafeWindow
// ==/UserScript==

let gcoords = [ 0, 0 ];

function calculateIncorrectedLatLong( latitude, longitude ) {
    latitude = -1 * latitude;
    longitude = ( 180 - Math.abs( longitude ) ) * ( longitude > 0 ? -1 : 1 );
	return { latitude, longitude };
}

const originalFetch = unsafeWindow.fetch;

const updateButton = () => {
	const button = document.querySelector('button[data-qa=perform-guess]');
	if ( ! button || button.disabled ) return;

	button.style.background = '#6817ae';
	button.innerText = 'GUESS AT ANTIPODE';
};
setInterval( updateButton, 250 );

unsafeWindow.fetch = new Proxy( originalFetch, {
	apply: function (target, that, args) {

		let [resource, config] = args;

        if (
            resource.match && (
                resource?.match( /^https:\/\/www\.geoguessr\.com\/api\/v\d\/games\// ) ||
                resource?.match( /^https:\/\/[^\.]+\.geoguessr\.com\/.*?\/(guess|pin)$/ )
            )
        ) {
            if ( config?.body ) {
                const orig = JSON.parse( config.body );
                if ( orig.lat && orig.lng ) {
                    console.log( orig );
                    const incorrected = calculateIncorrectedLatLong( orig.lat, orig.lng );
                    if ( incorrected.latitude && incorrected.longitude ) {
                        config.body = JSON.stringify( {
                            ...orig,
                            lat: incorrected.latitude,
                            lng: incorrected.longitude,
                        } );
                    }
                }
            }
        }

		const promise = Reflect.apply(target, that, args);

		return promise;
	}
} );