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와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 Tampermonkey 또는 Userscripts와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 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);

})();