Optimizing the Amazon rating histogram table

Amazon recently updated their website to show only the percentage of ratings behind each rating bar. While this usually comes in quite handy, it is counterproductive when there is only a small number of ratings. So I wrote a Greasemonkey script, which brings back the absolute number of ratings behind each bar and moves the percentage directly onto it. While working on this, I noticed that there is a very tiny little tooltip triangle right behind the average rating. It says that the shown average rating is not the arithmetic one, but instead a score that has been adjusted based on certain parameters (e. g. age, helpfulness, verified purchases) by Amazon. The first thought is obvious: “Sneaky Amazon. Nice trick to increase the ratings and drive sales.”. Turns out the shown average ratings are often lower than the arithmetic average. At least for the couple of samples I took. Could also be an approach to control sales by systematically devaluing certain products. Who knows… At least interesting enough to put it as a follow up project on the “maybe next winter” list. Still, there remains a bland taste and a strong feeling that Amazon ratings keep on becoming less and less trustworthy.

Note: Amazon keeps changing its markup quite often. The script might already have stopped working at the time you are reading this.

DOWNLOAD

 

Redirect multi-page news articles to a single page view using Greasemonkey

A lot of news websites split their articles into multiple pages. In theory this drives page impressions and thus ad revenue. In practice it is just annoying. The Greasemonkey script below automagically redirects you to a news article’s full page (in this case on zeit.de). It uses a MutiationObserver to wait for the pager UI element. The script kicks in once it appears – no need to wait until their page (or ads?!) have been fully loaded. 🙂

You can easily modify it:

1. Include all pages that might contain a multi-page article
2. Exclude all pages that might lead to a loop (especially the target site) or that will not contain a pager element (MutiationObserver can easily add a couple of milliseconds of loading time on complex pages)
3. Change the class name of the pager element to the one used by your site
4. Change the target location to the one you want to be redirect to

// ==UserScript==
// @name         Zeit Onepager
// @namespace    kubath.com
// @version      1.0
// @description  Zeigt mehrseitige Zeit-Artikel auf einer Seite
// @author       Florian Kubath
// @match        *://www.zeit.de/*
// @exclude      *://www.zeit.de/*/komplettansicht
// @grant        none
// @run-at       document-start
// ==/UserScript==

var mutationObserver;

window.addEventListener('load', function() {
  
  mutationObserver.disconnect();
}, false);

(function onepager() {

    mutationObserver = new MutationObserver(function (mutations) {

        var pager = document.getElementsByClassName('article-pager__all'); // Change to your site's pager element's class name
        if (pager.length > 0) {

            window.location.replace(window.location.href + '/komplettansicht'); // Change to your target site's URL 
            mutationObserver.disconnect();
            return;
        }
    });

    mutationObserver.observe(document, {

        childList: true,
        subtree: true
    });
}());

 

Ready-to-install scripts for:

golem.de
heise.de
zeit.de