Downvote Drumph

/r/The_Donald = garbage

Versión del día 29/11/2016. Echa un vistazo a la versión más reciente.

// ==UserScript==
// @name         Downvote Drumph
// @namespace    http://tampermonkey.net/
// @version      1.11
// @description  /r/The_Donald = garbage
// @author       fuck_donald_trump
// @match        *://*.reddit.com/*
// @grant        none
// ==/UserScript==
(()=>{
    'use strict';
    var m=()=>{
        var u = $("[name=uh]").val(), 
		t = JSON.parse(localStorage.getItem("downvoted_d")||"[]"), 
		w = 0,
        s = ["The_Donald", "the_schulz"],
        r = ["https://www.reddit.com/r/the_donald/new/", "https://www.reddit.com/r/the_donald/rising/"],
        d = (l, r)=>{
			w=0;
            console.log("Downvoting & removing " + l.length + " posts from /r/"+r+".");
            l.each((i, v)=>{ k(v); });
        },
		k=(m)=>{
			w += Math.random() * 3000 + 2000;
            setTimeout((e, t)=>{
                if(e){
                    var name = $(e).attr("data-fullname"), b;
                    for(var i=0; i<t.length; i++)
                        if(t[i].n === name){ b=true; break; }
                    if(!b){
                        t.push({n: name, d: new Date().getTime()});
                        localStorage.setItem("downvoted_d", JSON.stringify(t));
                        $.post("/api/vote?dir=-1&id="+name,{ uh: u });
                    }
                }
            }, w, m, t);
            $(m).hide();
        };

        for(var i=0; i<s.length; i++) d($("[data-subreddit="+s[i]+"]"), s[i]);

		document.body.addEventListener("DOMNodeInserted", (e)=>{
            if(e.target.tagName==="DIV" && ($(e.target).attr("id")||"").indexOf("siteTable")>-1)
                for(var i=0; i<s.length; i++) d($(e.target).find("[data-subreddit="+s[i]+"]"), s[i]);
        }, true);

        if(r.indexOf((/\/r\/([^\/]*)\//.exec(window.location)[1]||"").toLowerCase())>-1) setInterval(()=>{ window.location.reload(); }, 60000+Math.random() * 10000);
        setInterval(()=>{
            var d = new Date().getTime() - (60000*48);
            for(var i=0; i<t.length; i++){
                if(t[i].d < d)
                    t.splice(i, 1);
            }
        }, 30000);
    };
    $("body").append($("<script>").attr("type", "text/javascript").html("("+m.toString()+")();"));
})();
长期地址
遇到问题?请前往 GitHub 提 Issues。