Geoguessr PPS

Calculates your PPS on Geoguessr

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 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.

You will need to install an extension such as Stylus to install this style.

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

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

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

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

// ==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);

})();