tencent_live_review

以实时直播的形式观看腾讯NBA视频比赛 Watch Tencent NBA video games in real-time live broadcast [https://github.com/rejerry/nba-game-replay-live]

当前为 2021-06-14 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name tencent_live_review
  3. // @namespace https://github.com/rejerry/nba-game-replay-live
  4. // @version 0.0.1
  5. // @description 以实时直播的形式观看腾讯NBA视频比赛 Watch Tencent NBA video games in real-time live broadcast [https://github.com/rejerry/nba-game-replay-live]
  6. // @author rejerry
  7. // @match https://nba.stats.qq.com/schedule
  8. // @match https://nba.stats.qq.com/schedule/
  9. // @match https://kbs.sports.qq.com/*
  10. // @require https://cdn.staticfile.org/jquery/3.4.1/jquery.min.js
  11. // @grant GM_setValue
  12. // @grant GM_getValue
  13. // @grant GM_log
  14. // @grant unsafeWindow
  15. // @grant window.close
  16. // @grant window.focus
  17. // ==/UserScript==
  18.  
  19. (function () {
  20. 'use strict';
  21. const url = window.location.href;
  22.  
  23. let nStat = 0;
  24. const stat = function () {
  25. nStat = nStat + 1;
  26.  
  27. const a1 = $("div.goal");
  28. if (a1.length != 0) {
  29. a1.children().hide();
  30. console.log("done. stat page try time cost: " + nStat + " ms");
  31. clearInterval(intervalStat);
  32. }
  33. }
  34. let intervalStat;
  35. const bStat = url.indexOf("nba.stats.qq.com/schedule");
  36. if (bStat >= 0) {
  37. intervalStat = window.setInterval(stat, 1);
  38. }
  39.  
  40.  
  41. let nRecord = 0;
  42. const record = function () {
  43. nRecord = nRecord + 1;
  44.  
  45. const a1 = $("div.info > div.inner");
  46. if (a1.length != 0) {
  47. a1.hide();
  48. console.log("done. record page try time cost: " + nRecord + " ms");
  49. clearInterval(intervalRecord);
  50. }
  51. }
  52. let intervalRecord;
  53. const bRecord = url.indexOf("kbs.sports.qq.com");
  54. if (bRecord >= 0) {
  55. intervalRecord = window.setInterval(record, 1);
  56. }
  57.  
  58.  
  59. let nKbs = 0;
  60. const kbs = function () {
  61. nKbs = nKbs + 1;
  62.  
  63. const kbs = $("div.left-data-tabs > div.kbs-tabs-wrapper");
  64. if (kbs.length != 0) {
  65. kbs.hide();
  66. console.log("done. record page 'kbs' try time cost: " + nKbs + " ms");
  67. clearInterval(intervalKbs);
  68. }
  69. }
  70. let intervalKbs;
  71. if (bRecord >= 0) {
  72. intervalKbs = window.setInterval(kbs, 1);
  73. }
  74. })();