Show Flairless Count

Estimate flairless users on /r/thebutton/

Dovrai installare un'estensione come Tampermonkey, Greasemonkey o Violentmonkey per installare questo script.

Dovrai installare un'estensione come Tampermonkey o Violentmonkey per installare questo script.

Dovrai installare un'estensione come Tampermonkey o Violentmonkey per installare questo script.

Dovrai installare un'estensione come Tampermonkey o Userscripts per installare questo script.

Dovrai installare un'estensione come ad esempio Tampermonkey per installare questo script.

Dovrai installare un gestore di script utente per installare questo script.

(Ho già un gestore di script utente, lasciamelo installare!)

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

(Ho già un gestore di stile utente, lasciamelo installare!)

// ==UserScript==
// @name         Show Flairless Count
// @namespace    http://your.homepage/
// @version      0.2
// @description  Estimate flairless users on /r/thebutton/
// @author       /u/bwochinski
// @match        *://www.reddit.com/r/thebutton/*
// @grant        none
// ==/UserScript==

function parseFlairNum(flairLine) {
    flairLine = flairLine.split("~");
    var total = parseInt(flairLine.shift().split(" ")[0].replace(",",""));
    var estFlair = 0;
    for (var est in flairLine) {
        var curEst = parseInt(flairLine[est].split(" ")[0]);
        estFlair += curEst;
    }
    return total - estFlair;
}

var estFlairless = parseFlairNum($('div.titlebox p').text());
$('div.titlebox p:last').after("<p> &nbsp; &nbsp; ~" + estFlairless + " flairless users</p>");

//add flair text
$('div.titlebox p span.flair-no-press').text("non presser");
$('div.titlebox p span.flair-press-6').text("60-52s");
$('div.titlebox p span.flair-press-5').text("51-42s");
$('div.titlebox p span.flair-press-4').text("41-32s");
$('div.titlebox p span.flair-press-3').text("31-22s");
$('div.titlebox p span.flair-press-2').text("21-12s");
$('div.titlebox p span.flair-press-1').text("11-1s");
$('div.titlebox p span.flair-cant-press').text("can't press");