Reddit Uppers and Downers

By mistercow Last update Jun 2, 2009 — Installed 9,756 times.

Script is horrible. Use this instead.

in
Subscribe to Script is horrible. Use this instead. 1 post, 1 voice

timecube22 User
MozillaX11

From http://www.reddit.com/r/javascript/comments/9dn...
--
// ==UserScript==
// @name Reddit Up/Down CSS
// @namespace tritelife
// @include http://*.reddit.com/*/comments/*
// ==/UserScript==

var $ = unsafeWindow.jQuery;
$.getJSON(location.href+".json",null,function(r){
var css = [];
var searcher = function(comments) {
comments.forEach(function(comment){
css.push(['.comment.id-t1_',comment.data.id,' > div > div > p.tagline:after,.comment.id-t1_',comment.data.id,' > div > .collapsed:after{font-style:normal;content:\'(',comment.data.ups,' upvote',(comment.data.ups==1 ? '':'s'),', '+comment.data.downs,' downvote',(comment.data.downs===1 ? '':'s'),')\'}'].join(''));
if(typeof(comment.data.replies) === 'object') searcher(comment.data.replies.data.children);
});
};
searcher(r[1].data.children);
GM_addStyle(css.join(''));
});

Cross
Presentational HTML allowed.
Use <code> for inline code and <pre> for code blocks. Use &lt; and &gt; for literal < and >.
We help break paragraphs and link your links.
or cancel