Untitled


SUBMITTED BY: Guest

DATE: March 11, 2014, 5:21 a.m.

FORMAT: Text only

SIZE: 4.6 kB

HITS: 878

  1. // ==UserScript==
  2. // @name OSU Profile_Detail
  3. // @author JebwizOscar
  4. // @icon http://osu.ppy.sh/favicon.ico
  5. // @include http://osu.ppy.sh/u/*
  6. // @include https://osu.ppy.sh/u/*
  7. // @grant GM_xmlhttpRequest
  8. // @grant GM_openInTab
  9. // @grant GM_setValue
  10. // @grant GM_getValue
  11. // @version 1.5.30.0046
  12. // @updateURL http://userscripts.org/scripts/source/172708.user.js
  13. // ==/UserScript==
  14. var ver = 46;
  15. var pz = document.getElementsByClassName("prof-right")[0];
  16. var code = document.documentElement.innerHTML;
  17. var udt = code.match("var localUserId = ([0-9]+)");
  18. var uid = code.match("var userId = ([0-9]+)")[1];
  19. var e = code.match("var activeGameMode = ([0-9])")[1];
  20. null !== udt ? (ud = udt[1], udstr = "&ud=" + ud) : (ud = "0", udstr = "");
  21. var un = document.title;
  22. var server = "174.140.163.108"; //主站
  23. function expand(a, b) {
  24. activeTab = a, !$("#" + a).hasClass("expanded") || b ? ($("#" + a).addClass("expanded"), $("#" + a).removeClass("unexpanded"), $("#" + a).slideDown(
  25. 500), b && (window.location.hash = "#_" + activeTab)) : ($("#" + a).slideUp(
  26. 500, function () {
  27. $("#" + a).addClass("unexpanded")
  28. }), $("#" + a).removeClass("expanded"))
  29. }
  30. var pre='\
  31. Array.prototype.indexOf = function(val) { \
  32. for (var i = 0; i < this.length; i++) { \
  33. if (this[i] == val) return i; \
  34. } \
  35. return -1; \
  36. }; \
  37. Array.prototype.remove = function(val) { \
  38. var index = this.indexOf(val); \
  39. if (index > -1) { \
  40. this.splice(index, 1); \
  41. } \
  42. };\
  43. if (typeof($("#userpage"))!="undefined" && $("#userpage").length>0){\
  44. var userpage = $("#userpage");\
  45. if (userpage.hasScrollBar())\
  46. {\
  47. if (typeof($(".userpage-expand"))!="undefined" && $(".userpage-expand").length>0)\
  48. $(".userpage-expand").slideUp(100);\
  49. userpage.after("<div class=\'userpage-expand\'>↯</div>");\
  50. $(".userpage-expand").click(function() {\
  51. userpage.css("height", userpage.css("max-height"));\
  52. userpage.css("max-height", "600px").animate({ "height" : userpage.get(0).scrollHeight }, 1000);\
  53. $(".userpage-expand").slideUp(100);\
  54. });\
  55. }\
  56. }\
  57. function setGameMode(mode, first) {\
  58. $(".profileGameModeButton").removeClass("active");\
  59. $("#gm-" + mode).addClass("active");\
  60. activeGameMode = mode;\
  61. \
  62. $(".expanded").slideUp(500).removeClass("expanded");\
  63. \
  64. if (!first) {expandProfile("general", true);}\
  65. $(\'#api\').load(\'https://osutools.duapp.com/pf_det.php?u=\' + userId + \'&m=\' + mode + \'&';
  66. var pst='\'); }';
  67. function main() {
  68. qstr="sv=" + ver + udstr ;
  69. var a, b;
  70. a = document.getElementsByTagName("head")[0], b = document.createElement("style"), b.type = "text/css", b.innerHTML = ".unexpanded { display:none; }", a.appendChild(
  71. b), GM_xmlhttpRequest({
  72. method: "GET",
  73. url: "http://" + server + "/pf_det.php?"+qstr+ "&u=" + uid + "&m=" + e,
  74. headers: {
  75. Referer: location.href
  76. },
  77. onload: function (a) {
  78. var c, b = a.responseText;
  79. pz.innerHTML += '<table class="beatmapListing" id="api" cellspacing="0" >'+b+'</table>',
  80. script = document.createElement("script"),
  81. script.innerHTML = expand, document.body.appendChild(script),
  82. script2 = document.createElement("script"),
  83. script2.innerHTML = pre+qstr+pst, document.body.appendChild(script2),
  84. (c = "jeb-w", unsafeWindow.disqus_identifier = "pl_" + uid, unsafeWindow.disqus_url = "http://osu.ppy.sh/u/" + uid, unsafeWindow.disqus_title = "Talk: " + un, function () {
  85. var a = document.createElement("script");
  86. a.type = "text/javascript", a.async = !0, a.src = "//" + c + ".disqus.com/embed.js", (
  87. document.getElementsByTagName("head")[0] || document.getElementsByTagName("body")[0]).appendChild(a)
  88. }())
  89. }
  90. })
  91. }
  92. main();

comments powered by Disqus