Advertisement
Guest User

Untitled

a guest
Aug 3rd, 2015
160
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.48 KB | None | 0 0
  1. // ==UserScript==
  2. // @name osu! Profile Detail
  3. // @description Show some API stats in profile page
  4. // @author JebwizOscar
  5. // @icon http://osu.ppy.sh/favicon.ico
  6. // @include http://osu.ppy.sh/u/*
  7. // @include https://osu.ppy.sh/u/*
  8. // @grant GM_xmlhttpRequest
  9. // @grant GM_openInTab
  10. // @grant GM_setValue
  11. // @grant GM_getValue
  12. // @version 1.6.0.0057
  13. // @namespace https://greasyfork.org/users/3079
  14. // ==/UserScript==
  15. var ver = 57;
  16. var pz = document.getElementsByClassName("prof-right")[0];
  17. var code = document.documentElement.innerHTML;
  18. var udt = code.match("var localUserId = ([0-9]+)");
  19. var prefix = document.location.protocol + "//osupd.og.gs/";
  20. // freenom suspended the old domain
  21. if (code.match("var userId = ([0-9]+)")){
  22. var uid = code.match("var userId = ([0-9]+)")[1];
  23. var e = code.match("var activeGameMode = ([0-9])")[1];
  24. if (null !== udt) {
  25. ud = udt[1];
  26. udstr = "&ud=" + ud;
  27. } else {
  28. ud = "0";
  29. udstr = "";
  30. }
  31. function main() {
  32. qstr = "sv=" + ver + udstr;
  33. var a, b;
  34. a = document.getElementsByTagName("head")[0];
  35. b = document.createElement("style");
  36. b.type = "text/css";
  37. b.innerHTML = ".unexpanded { display:none; }";
  38. a.appendChild(b);
  39. GM_xmlhttpRequest({
  40. method: "GET",
  41. url: prefix + "pf_det.php?" + qstr + "&u=" + uid + "&m=" + e,
  42. headers: {
  43. Referer: location.href
  44. },
  45. onload: function(a) {
  46. var c, b = a.responseText;
  47. pz.innerHTML += '<table class="beatmapListing" id="api" cellspacing="0" >' + b + '</table>';
  48. script = document.createElement("script");
  49. script.innerHTML = 'var sv=' + ver;
  50. document.body.appendChild(script);
  51. GM_xmlhttpRequest({
  52. method: "GET",
  53. url: prefix + "pf_det.js",
  54. headers: {
  55. Referer: location.href
  56. },
  57. onload: function(a) {
  58. var b = a.responseText;
  59. script = document.createElement("script");
  60. script.innerHTML = b;
  61. document.body.appendChild(script);
  62. }
  63. });
  64. }
  65. });
  66.  
  67. }
  68. main();
  69. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement