// ==UserScript== // @name osu! pp for Scoreboard [Offline Ver.] // @namespace http://wa.vg/ // @author JebwizOscar // @icon http://osu.ppy.sh/favicon.ico // @include http://osu.ppy.sh/b/* // @include https://osu.ppy.sh/b/* // @include http://osu.ppy.sh/s/* // @include https://osu.ppy.sh/s/* // @include http://osu.ppy.sh/p/beatmap?* // @include https://osu.ppy.sh/p/beatmap?* // @include https://osu.ppy.sh/p/api // @include http://osu.ppy.sh/p/api // @grant GM_getValue // @grant GM_setValue // @grant GM_deleteValue // @copyright 2016, ieb // @version 16.07.23.3 // @namespace https://greasyfork.org/users/3079 // @require https://code.jquery.com/jquery-1.8.3.min.js // @description a remake of https://greasyfork.org/en/scripts/3280-osu-pp-for-scoreboard (osu! pp for Scoreboard) // @downloadURL https://update.greasyfork.icu/scripts/21605/osu%21%20pp%20for%20Scoreboard%20%5BOffline%20Ver%5D.user.js // @updateURL https://update.greasyfork.icu/scripts/21605/osu%21%20pp%20for%20Scoreboard%20%5BOffline%20Ver%5D.meta.js // ==/UserScript== key = GM_getValue("osu-api-key", "none"); url = document.location.href; if (~url.indexOf('/api')) { if (typeof ($($('.feedback div')[2]).text().split(' ')[2]) !== 'undefined') { key = $($('.feedback div')[2]).text().split(' ')[2]; GM_setValue("osu-api-key", key); alert("New Key Updated: " + key); } } else { if (key !== "none") { endpoint = '/api/get_scores?k='+key; suf = $('.beatmapTab.active').attr("href").replace('/b/','&b='); mode = $('.beatmapTab.active').attr("href").replace(/.*&m=(\d+)/,'$1'); leader = $($($('.scoreLeader')[0]).children(0).children(0).children(0).children(0)[1]).attr("href").replace('/u/','&u='); $.get(endpoint+suf+leader, {}, function(data) { for(var i in data){ $($('.scoreLeader')[0]).children(0).append('