3 ms·
This makes it really easy to add average karma to the comment section for every user. For instance, you can paste the below into the console, and should add av
by jcampbell1 12y ago
This makes it really easy to add average karma to the comment section for every user. For instance, you can paste the below into the console, and should add average karma data for each user.
Array.prototype.forEach.call(document.querySelectorAll('a[href^=user]'),
function(v,k) {
var s = document.createElement("script");
s.src = '//hacker-news.firebaseio.com/v0/user/' + v.innerHTML + '.json?callback=ud_' + k;
document.head.appendChild(s);
window['ud_' + k] = function(user_data){
var avg_karma = user_data.karma / user_data.submitted.length;
v.innerHTML += ' (' + avg_karma.toFixed(1) + ')';
}
}
);