直播吧NBA录像-页面美化

直播吧NBA录像-页面美化.

  1. // ==UserScript==
  2. // @name 直播吧NBA录像-页面美化
  3. // @namespace https://www.zhibo8.cc/nba/luxiang.htm
  4. // @version 1.0
  5. // @description 直播吧NBA录像-页面美化.
  6. // @author jyking
  7. // @match *://www.zhibo8.cc/nba/luxiang.htm
  8. // @require https://cdn.bootcss.com/jquery/3.4.1/jquery.min.js
  9. // @grant none
  10. // ==/UserScript==
  11.  
  12. (function() {
  13. 'use strict';
  14. // 引入CSS方法
  15. let $ = window.jquery = window.$
  16. function appendCss(url) {
  17. $('head').append($('<link rel="stylesheet" href="' + url + '">'));
  18. }
  19. function appendJs(url) {
  20. $("body").append($('<script type="text/javascript" src="' + url +'"></script>'));
  21. }
  22.  
  23. function loader() {
  24. appendJs("https://cdn.bootcss.com/jquery/3.4.1/jquery.min.js")
  25. }
  26.  
  27. // 获取比赛数据
  28. let boxArr = []
  29. let $dataBoxArr = $("div#body > #left > .box").slice(0,2)
  30. $dataBoxArr.map(function(){
  31. let box = {};
  32. let dateWeekArr = []
  33.  
  34. // 获取日期
  35. let $tmpDateWeek = $(this).find(".titlebar h2")
  36. if ($tmpDateWeek.length <= 0){
  37. return false
  38. }
  39. dateWeekArr = $tmpDateWeek.html().split(" ")
  40. box.date = dateWeekArr[0]
  41. box.week = dateWeekArr[1]
  42. box.content = []
  43.  
  44. if ($(this).find(".content b").length <=0) {
  45. console.log("本日暂无比赛录像")
  46. boxArr.push(box)
  47. return false
  48. }
  49. // 获取队伍及链接
  50. let $tmpTeam = $(this).find(".content b")
  51. $tmpTeam.map(function(){
  52. let teamvs = {}
  53. let tmpNames = $(this).html().split(" ")[0].split("vs")
  54. let tmpHref = "https://www.zhibo8.cc/" + $(this).find("a").attr("href")
  55. teamvs.tesm1 = tmpNames[0]
  56. teamvs.tesm2 = tmpNames[1]
  57. teamvs.url = tmpHref
  58. box.content.push(teamvs)
  59. })
  60.  
  61. boxArr.push(box)
  62. })
  63.  
  64. console.log(boxArr)
  65.  
  66. })();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址