您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
条目页显示VIB排名
当前为
// ==UserScript== // @name VIBRankFetch // @namespace https://jirehlov.com // @version 0.1 // @description 条目页显示VIB排名 // @include /^https?://(bangumi|bgm|chii).(tv|in)/subject/.*$/ // @author Jirehlov // @grant none // @license MIT // ==/UserScript== (function() { 'use strict'; function getVIBRank(id) { return fetch(`https://api.jirehlov.com/vib/${id}`, { method: 'GET', redirect: 'manual' }) .then(response => { if (response.status === 200) { return response.json(); } else { throw new Error('VIB rank api: Response status is not 200 OK'); } }) .then(data => data.VIB_rank) .catch(error => { console.error('Error fetching VIB rank:', error); return null; }); } let id = window.location.pathname.split('/')[2]; getVIBRank(id) .then(vibRank => { if (vibRank !== null && vibRank !== 0) { const lastDiv = document.querySelector('.global_score > div:last-child'); if (lastDiv) { const vibDiv = document.createElement('div'); vibDiv.innerHTML = '<small class="grey">Very Important Bangumier Ranked:</small><small class="alarm">#' + vibRank + '</small>'; vibDiv.style.marginLeft = '38px'; lastDiv.after(vibDiv); } } }); })();