Geoguessr PPS

Calculates your PPS on Geoguessr

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey, Greasemonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

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

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

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

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्क्रिप्ट व्यवस्थापक एक्स्टेंशन इंस्टॉल करावे लागेल.

(माझ्याकडे आधीच युझर स्क्रिप्ट व्यवस्थापक आहे, मला इंस्टॉल करू द्या!)

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

(माझ्याकडे आधीच युझर स्टाईल व्यवस्थापक आहे, मला इंस्टॉल करू द्या!)

// ==UserScript==
// @name           Geoguessr PPS
// @description    Calculates your PPS on Geoguessr
// @author         Octahedron
// @version        1.0.1
// @icon           http://tampermonkey.net/favicon.ico
// @match          https://geoguessr.com/results/*
// @include        https://www.geoguessr.com/results/*
// @grant          none
// @run-at         document-idle
// @require        https://ajax.googleapis.com/ajax/libs/jquery/2.2.0/jquery.js
// @namespace https://greasyfork.org/users/824280
// ==/UserScript==

(function() {
    'use strict';

    setTimeout(function() {
        let scoreBoxes = document.getElementsByClassName("results-highscore__guess-cell-score");
        let timeBoxes = document.getElementsByClassName("results-highscore__guess-cell-details");
        let numPlayers = scoreBoxes.length / 6;
        for(let i = 5; i < scoreBoxes.length; i += 6) {
            let score = parseInt(scoreBoxes[i].innerText.replace(/,/g, ''));
            let time = parseInt(timeBoxes[i].innerText.substring(6).replace(/[^0-9]/g, ''));
            timeBoxes[i].innerText += `\n${(score/time).toFixed(2)} PPS`;
            console.log((score / time).toFixed(2));
        }
    }, 1500);

})();