您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Re-calculating Digikala ratings based on Laplace's rule of succession
// ==UserScript== // @name Digikala-Rating-Laplace // @namespace http://github.com/ArmanJR // @version 0.1 // @description Re-calculating Digikala ratings based on Laplace's rule of succession // @author Arman and Sadaf // @match https://www.digikala.com/product* // @icon https://www.digikala.com/logo192.png // @license MIT // @grant none // ==/UserScript== (function() { 'use strict'; document.onreadystatechange = function () { if (document.readyState === 'complete') { var ratingElement = document.querySelectorAll('.InfoSection_infoSection__leftSection__wq25_ p.mr-1.text-body-2')[0]; var rating = parseFloat(ratingElement.innerHTML.replace(/([۰-۹])/g, token => String.fromCharCode(token.charCodeAt(0) - 1728))); var num = parseFloat(document.querySelectorAll('.InfoSection_infoSection__leftSection__wq25_ p.mr-1.text-caption.color-300')[0].innerHTML.replace('(', '').replace(')', '').replace(/([۰-۹])/g, token => String.fromCharCode(token.charCodeAt(0) - 1728))); var first = rating + (5 - rating) / (num + 1); var second = first + (1 - first) / (num + 2); ratingElement.innerHTML += ' <span style="color:red;">' + second.toString().substr(0, 4).replace(/[0-9]/g, w => String.fromCharCode(w.charCodeAt(0) + 1728) ) + ' '; } } })();
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址