您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Adds average rating of film to film pages
- // ==UserScript==
- // @name Letterboxd Average Rating
- // @namespace https://github.com/rcalderong/userscripts
- // @description Adds average rating of film to film pages
- // @copyright 2014+, Ramón Calderón (http://rcalderon.es)
- // @homepageURL https://github.com/rcalderong/userscripts
- // @supportURL https://github.com/rcalderong/userscripts/issues
- // @icon https://raw.githubusercontent.com/rcalderong/userscripts/master/img/letterboxd_icon.png
- // @license GPLv3; http://www.gnu.org/licenses/gpl.html
- // @version 1.3
- // @include http://letterboxd.com/film/*
- // @include http://letterboxd.com/film/*/crew/*
- // @include http://letterboxd.com/film/*/studios/*
- // @include http://letterboxd.com/film/*/genres/*
- // @exclude http://letterboxd.com/film/*/views/*
- // @exclude http://letterboxd.com/film/*/lists/*
- // @exclude http://letterboxd.com/film/*/likes/*
- // @exclude http://letterboxd.com/film/*/fans/*
- // @exclude http://letterboxd.com/film/*/ratings/*
- // @exclude http://letterboxd.com/film/*/reviews/*
- // @grant none
- // ==/UserScript==
- var sectionElt = document.getElementsByClassName("ratings-histogram-chart")[0],
- ratingsPageUrl = sectionElt.getElementsByTagName("a")[0].href,
- dataElt = sectionElt.querySelector("span.average-rating meta"),
- oneToTenRating = parseFloat(dataElt.getAttribute("content")),
- oneToFiveRating = (oneToTenRating / 2).toFixed(1),
- ratingElt = document.createElement("a"),
- ratingInnerElt = document.createElement("span");
- // Create element to be inserted in page
- ratingElt.className = "rating-green tooltip";
- ratingElt.style.position = "absolute";
- ratingElt.style.top = "0";
- ratingElt.style.left = "72px";
- ratingElt.href = ratingsPageUrl;
- ratingElt.setAttribute("title", oneToFiveRating + " stars" +
- " (" + oneToTenRating + "/10)");
- ratingInnerElt.className = "rating rated-" + Math.round(oneToTenRating);
- ratingElt.appendChild(ratingInnerElt);
- // Insert element in page
- sectionElt.insertBefore(ratingElt, sectionElt.children[1]);
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址