您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
网易云音乐每日歌曲推荐界面显示评论数
// ==UserScript== // @name 网易云音乐显示评论数 // @version 1.0 // @namespace https://greasyfork.org/zh-CN/users/297892 // @description 网易云音乐每日歌曲推荐界面显示评论数 // @author 移影残风 // @match http*://music.163.com/* // @require https://cdn.bootcss.com/jquery/3.3.1/jquery.min.js // @grant none // ==/UserScript== (function () { 'use strict'; window.onload = function () { console.log('网易云音乐每日歌曲推荐界面显示评论数') //console.log('iframe:' + $("iframe")[0].contentWindow.$(".txt:eq(2) a").attr('href').split('id=')[1]) //console.log('iframe:' + $("iframe")[0].contentWindow.$(".txt:eq(2) a b").attr('title')) $("iframe")[0].contentWindow.$("thead tr").append('<th><div style="padding: 8px 10px;">评论数</div></th>') for (let i = 0; i <= 29; i++) { let selector = ".txt:eq(" + i + ") a"; let musicId = $("iframe")[0].contentWindow.$(selector).attr('href').split('id=')[1] let selector2 = ".txt:eq(" + i + ")"; let url = "https://music.163.com/api/v1/resource/comments/R_SO_4_" + musicId + "?limit=20&offset=0"; $.get(url, function (data) { let jsonObj = JSON.parse(data); let commentCount = jsonObj.total; $("iframe")[0].contentWindow.$(selector2).parents("tr").append('<td class=""><div class="f-cb"><div class="tt"><div class="ttc"><span>'+commentCount+'</span></div></div></div></td>') }) } } })();