// ==UserScript== // @name Better Tripadvisor // @description Precise ratings, no restaurant ads, website link, phone number, google search link // @namespace KrisWebDev // @author KrisWebDev // @include http://www.tripadvisor.tld/* // @include https://www.tripadvisor.tld/* // @version 2020.08 // @grant GM_xmlhttpRequest // @grant GM_addStyle // @require http://code.jquery.com/jquery-2.1.4.min.js // @icon https://static.tacdn.com/favicon.ico // ==/UserScript== this.$ = this.jQuery = jQuery.noConflict(true); GM_addStyle('.ui_icon.google::before { content: "\u2315"; }'); // Restaurants: Remove adds GM_addStyle('div[data-test="SL_list_item"] { display: none; }'); /* PRECISE RATINGS */ var coeff = 5; var result = 0; var sumReviews = 0; var percentReviews = 0; var stop = 0; // Hotels $("label[for^='ReviewRatingFilter_']").parent("li").each(function(index,val) { var irating = $(this).children("span").last().text(); console.log(irating); percentReviews = parseInt(irating.replace(/\s+/g, '')); result += percentReviews*coeff--; sumReviews += percentReviews; }); if (sumReviews) { result = (Math.round(result/sumReviews*10))/10; // console.log("Result="+result); $("span[class*='__overallRating']").css("display","hide"); $("div#ABOUT_TAB").parent().parent().before($("