Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ==UserScript==
- // @name osu! Profile Detail
- // @description Show some API stats in profile page
- // @author JebwizOscar
- // @icon http://osu.ppy.sh/favicon.ico
- // @include http://osu.ppy.sh/u/*
- // @include https://osu.ppy.sh/u/*
- // @grant GM_xmlhttpRequest
- // @grant GM_openInTab
- // @grant GM_setValue
- // @grant GM_getValue
- // @version 1.6.0.0057
- // @namespace https://greasyfork.org/users/3079
- // ==/UserScript==
- var ver = 57;
- var pz = document.getElementsByClassName("prof-right")[0];
- var code = document.documentElement.innerHTML;
- var udt = code.match("var localUserId = ([0-9]+)");
- var prefix = document.location.protocol + "//osupd.og.gs/";
- // freenom suspended the old domain
- if (code.match("var userId = ([0-9]+)")){
- var uid = code.match("var userId = ([0-9]+)")[1];
- var e = code.match("var activeGameMode = ([0-9])")[1];
- if (null !== udt) {
- ud = udt[1];
- udstr = "&ud=" + ud;
- } else {
- ud = "0";
- udstr = "";
- }
- function main() {
- qstr = "sv=" + ver + udstr;
- var a, b;
- a = document.getElementsByTagName("head")[0];
- b = document.createElement("style");
- b.type = "text/css";
- b.innerHTML = ".unexpanded { display:none; }";
- a.appendChild(b);
- GM_xmlhttpRequest({
- method: "GET",
- url: prefix + "pf_det.php?" + qstr + "&u=" + uid + "&m=" + e,
- headers: {
- Referer: location.href
- },
- onload: function(a) {
- var c, b = a.responseText;
- pz.innerHTML += '<table class="beatmapListing" id="api" cellspacing="0" >' + b + '</table>';
- script = document.createElement("script");
- script.innerHTML = 'var sv=' + ver;
- document.body.appendChild(script);
- GM_xmlhttpRequest({
- method: "GET",
- url: prefix + "pf_det.js",
- headers: {
- Referer: location.href
- },
- onload: function(a) {
- var b = a.responseText;
- script = document.createElement("script");
- script.innerHTML = b;
- document.body.appendChild(script);
- }
- });
- }
- });
- }
- main();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement