您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Use this script to see the average score of unpopular animes/mangas that have unweighted scores "N/A" on MAL.
当前为
// ==UserScript== // @name Show The Average Score For Animes/Mangas Instead Of N/A // @namespace AverageScore // @version 0.2 // @description Use this script to see the average score of unpopular animes/mangas that have unweighted scores "N/A" on MAL. // @author hacker09 // @match https://myanimelist.net/anime/* // @match https://myanimelist.net/manga/* // @match https://myanimelist.net/anime.php?id=* // @match https://myanimelist.net/manga.php?id=* // @run-at document-end // @grant none // ==/UserScript== (function() { 'use strict'; if (document.querySelector("div.score-label.score-na") !== null) { var statscontent, i; async function GetStats() //Creates a function to get the stats { //Starts the function var url = document.querySelector("a[href*='stats']").href; const response = await fetch(url); //Fetch the stats page const html = await response.text(); //Gets the fetch response const newDocument = new DOMParser().parseFromString(html, 'text/html'); //Parses the fetch response statscontent = newDocument.querySelector("table.score-stats").textContent; //Creates a variable to hold the stats numbers } //Finishes the async function async function Start() { //Starts the function await GetStats(); //Starts the function //Start the math to process the variable statscontent TextContent into actual usable numbers var stats = []; var votes = 0; var result = 0; var raw = document.querySelector("table.score-stats").textContent; //Creates a variable to hold the stats numbers; //Add the variable statscontent TextContent into the variable named raw raw = raw.split("("); raw.shift(); for (i = 0; i < document.querySelectorAll("div.updatesBar").length; i++) { raw[i] = raw[i].split(" votes"); raw[i].pop(); stats.push(parseInt(raw[i].pop())); votes = votes + stats[i]; //calculate the amount of votes result = result + stats[i] * (document.querySelectorAll("div.updatesBar").length - i); //calculate the average } result = result / votes; document.querySelector("div.score-label.score-na").innerText = result.toFixed(2); //Show the Average Score results } //Finishes the function Start Start(); //Starts the function } //Finishes the if statement })();
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址