您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Display next to the MAL score, the average score of your friends
当前为
// ==UserScript== // @name MyAnimeList(MAL) - Average Friends Score // @version 1.0.9 // @description Display next to the MAL score, the average score of your friends // @author Cpt_mathix // @include /^https?:\/\/myanimelist\.net\/(anime|manga)\/\d+/ // @include /^https?:\/\/myanimelist\.net\/(anime|manga)\/\d+\/.*/ // @include /^https?:\/\/myanimelist\.net\/(anime|manga)\.php\?id=\d+/ // @grant none // @namespace https://greasyfork.org/users/16080 // ==/UserScript== (function($) { var url = document.querySelector("#horiznav_nav > ul > li > a").href.match(/(^https?:\/\/myanimelist\.net\/(anime|manga)\/\d+\/?[^\/?]*)/)[1]; $.get(url + '/stats', function(data) { var elements = $($.parseHTML(data)).find('table.table-recently-updated > tbody > tr:nth-child(n) > td:nth-child(2)').not('.borderClass.fw-b.ac'); var sum = 0; var count = 0; $(elements).each( function() { var score = $(this).text(); if(!isNaN(score)) { sum += parseInt(score); count += 1; } }); var averageScore; if (sum > 0) { averageScore = (sum/count).toPrecision(3); } else { averageScore = '-'; } $('#content div > h2').each( function() { if ($(this).text().trim() === "Statistics") { var friendScoreAnchor = $(this).next(); var newElement = document.createElement('div'); $(newElement).html('<span class="dark_text">Friend Score:</span> ' + averageScore); $(newElement).addClass('spaceit_pad'); $(newElement).insertAfter(friendScoreAnchor); $(friendScoreAnchor).addClass('spaceit_pad'); } }); }); })(jQuery);