See the % of people that have watched and favorited an anime/manga in the entry status page.
当前为
// ==UserScript==
// @name Anime/Manga Favorited Status %
// @namespace FavoriteStatus%
// @version 0.4
// @description See the % of people that have watched and favorited an anime/manga in the entry status page.
// @author hacker09
// @include /^https:\/\/myanimelist\.net\/(anime|manga)\/[\d]+/
// @include /^https:\/\/myanimelist\.net\/(anime|manga)\/[\d]+\/.*\/stats/
// @icon https://www.google.com/s2/favicons?domain=myanimelist.net
// @run-at document-end
// @grant none
// ==/UserScript==
(async function() {
'use strict';
if (document.body.innerText.match('Status: Not yet aired') === null) //If the opened entry is airing or finished airing
{ //Starts the if condition
const response1 = await (await fetch('https://api.jikan.moe/v3/' + location.href.split('/')[3] + '/' + location.href.match(/\d+/)[0] + '/stats')).json(); //Get Stats
var TotalUsers = response1.total; //Save the TotalUsers to variable
var PTWR = response1.plan_to_watch; //Save the PTWR to variable
var Information = [...[...document.querySelectorAll("h2")].find(h2 => h2.textContent === "Information").parentNode.querySelectorAll("div")]; //Save the Information stats to variable
var Favorites = parseFloat(Information.find(info => info.innerText.includes('Favorites: ')).innerText.match(/(\d+,)?(\d+,)?\d+/)[0].replaceAll(',', '')); //Save the Favs to variable
if (location.href.match(/^https:\/\/myanimelist\.net\/(anime|manga)\/[\d]+\/.*\/stats/) !== null) //If the user is on the stats page
{ //Starts the if condition
var SummaryStats = [...[...document.querySelectorAll("h2")].find(h2 => h2.textContent === "Summary Stats").parentNode.querySelectorAll("span")]; //Save the summary stats to variable
SummaryStats.find(info => info.innerText.includes("Total:")).innerText = 'Favorited: ' + ((Favorites) / ((TotalUsers) - (PTWR))).toLocaleString("en", { //Do the math and show the result
style: 'percent', //Show the result as %
minimumFractionDigits: 2 //Show the % with 2 decimals
}) + '\nTotal:'; //Add a break line and show the total number below the Favorites: % number
SummaryStats.find(info => info.innerText.includes("Total:")).title = `( ${Favorites} )/(( ${TotalUsers} ) - ( ${PTWR} ))`; //Show the math on mouse hover
} //Finishes the if condition
if (location.href.match('stats') === null) //If the user is not on the stats page
{ //Starts the if condition
document.querySelector("div.detail-characters-list.clearfix").querySelectorAll('div.spaceit_pad').forEach(async function(el) { //For each character on the page
const response2 = await (await fetch('https://api.jikan.moe/v3/character/' + el.parentNode.querySelector('a').href.match(/\d+/)[0])).json(); //Get the charater stats
el.innerText += '\nFavorited: ' + ((response2.member_favorites) / ((TotalUsers) - (PTWR))).toLocaleString("en", { //Do the math and show the result
style: 'percent', //Show the result as %
minimumFractionDigits: 2 //Show the % with 2 decimals
}); //Add a break line and show the % below the text
el.title += `( ${response2.member_favorites} )/(( ${TotalUsers} ) - ( ${PTWR} ))`; //Show the math on mouse hover
}); //Finishes the for each condition
} //Finishes the if condition
} //Finishes the if condition
})();
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址