您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Display the exact Tripadvisor note after the "bubbles"
// ==UserScript== // @name Tripadvisor precise note // @description Display the exact Tripadvisor note after the "bubbles" // @namespace KrisWebDev // @author KrisWebDev // @include http://www.tripadvisor.tld/* // @include https://www.tripadvisor.tld/* // @version 1.4 // @grant none // @require http://code.jquery.com/jquery-2.1.4.min.js // ==/UserScript== this.$ = this.jQuery = jQuery.noConflict(true); var coeff = 5; var result = 0; var sumReviews = 0; var percentReviews = 0; $(".reviews .row_count").each(function(index, val) { //console.log($(this).text()); percentReviews = parseInt($(this).text().replace(/\s+/g, '')); result += percentReviews*coeff--; sumReviews += percentReviews; }); if (sumReviews) { result = (Math.round(result/sumReviews*10))/10; $(".reviews .overallRating").text(result+" "); }