哔哩哔哩直播高能榜

哔哩哔哩直播高能榜小工具

  1. // ==UserScript==
  2. // @name 哔哩哔哩直播高能榜
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.6.1
  5. // @license MIT License
  6. // @description 哔哩哔哩直播高能榜小工具
  7. // @author Namishibuki
  8. // @require https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js
  9. // @match https://live.bilibili.com/*
  10. // @icon https://www.google.com/s2/favicons?sz=64&domain=bilibili.com
  11. // @grant GM_xmlhttpRequest
  12. // @grant GM_addStyle
  13. // ==/UserScript==
  14.  
  15. (function () {
  16. 'use strict';
  17. window.onload = function () {
  18. GM_addStyle(".content.border-box {display: none;}"); //屏蔽"获得轮播资源位推荐奖励!"弹窗
  19. var id = __NEPTUNE_IS_MY_WAIFU__.roomInitRes.data.uid
  20. $("#rank-list-ctnr-box li:first").text("高能用户(...)")
  21. //立即执行一次
  22. $.ajax({
  23. type: "get",
  24. url: "https://api.live.bilibili.com/xlive/general-interface/v1/rank/getOnlineGoldRank?ruid=" + id + "&roomId=1&page=1&pageSize=50",
  25. success: function (res) {
  26. $("#rank-list-ctnr-box li:first").text("高能用户(" + res.data.onlineNum + ")")
  27. }
  28. })
  29. //每5s获取一次
  30. setInterval(function () {
  31. $.ajax({
  32. type: "get",
  33. url: "https://api.live.bilibili.com/xlive/general-interface/v1/rank/getOnlineGoldRank?ruid=" + id + "&roomId=1&page=1&pageSize=50",
  34. success: function (res) {
  35. $("#rank-list-ctnr-box li:first").text("高能用户(" + res.data.onlineNum + ")")
  36. }
  37. })
  38. }, 10000)
  39. }
  40. // Your code here...
  41. })();