您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Replaces rating on IMDb title pages with Non-US user rating.
当前为
- // ==UserScript==
- // @name IMDb rating sanitiser.
- // @namespace dicks
- // @description Replaces rating on IMDb title pages with Non-US user rating.
- // @include http*://*.imdb.com/title/tt*
- // @include http*://imdb.com/title/tt*
- // @version 0001
- // @require https://code.jquery.com/jquery-2.1.1.min.js
- // ==/UserScript==
- function main(url, combined) {
- $.ajax({
- url: url + 'ratings-international',
- success: function (data) {
- var line = $(data).find('#tn15content').find('p').eq(0).text();
- if (!line) {
- return false;
- }
- var realvotes = line.match(/^(\d+) Non-US users/)[1].replace(/\B(?=(\d{3})+(?!\d))/g, ',') + ' non-US ',
- realscore = line.match(/vote of (\d+\.?\d*) \/ 10/)[1];
- if (!combined) {
- var star = $('.titlePageSprite').eq(1),
- text = $('.star-box-details').eq(0).find('span'),
- rate = text.eq(0),
- vote = text.eq(3);
- } else {
- var star = $('#general-voting-stars'),
- rate = $('.starbar-meta').find('b').eq(0),
- vote = $('.tn15more').eq(0);
- }
- star.fadeOut(400);
- rate.fadeOut(400);
- vote.fadeOut(400);
- setTimeout(function () {
- if (!combined) {
- star.text(realscore);
- } else {
- star.width((realscore * 20));
- }
- rate.text(realscore + (combined ? '/10' : ''));
- vote.text(realvotes + (combined ? 'votes' : ''));
- }, 400);
- star.fadeIn(400);
- rate.fadeIn(400);
- vote.fadeIn(400);
- }
- });
- }
- combined = (location.href.match(/\/combined\/?/)) ? true : false;
- url = location.href.replace(/(combined\/?|\?ref_=).*/g, '');
- if (url.match(/\/title\/tt\d{7,}\/$/)) {
- main(url, combined);
- }