Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
A user script (I use chrome's tamper monkey) for making hacker news cleanly more informational (ie. remove visual clutter... IMHO)
// ==UserScript==
// @name HackerNews Scrubbed
// @namespace http://jadn.com/bob
// @version 0.1
// @description enter something useful
// @match https://news.ycombinator.com/*
// @copyright 2014+, bherrmann
// ==/UserScript==
document.getElementsByTagName("table")[0].getElementsByTagName("tr")[0].style.display="none";
document.getElementsByTagName("table")[0].style.backgroundColor="#FFF";
tds = document.getElementsByTagName("table")[0].getElementsByTagName("td");
trs = document.getElementsByTagName("table")[0].getElementsByTagName("tr");
trs[trs.length-1].style.display="none";
trs[trs.length-2].style.display="none";
var pattern = new RegExp(/^\d+\.$/);
for(i=0;i<tds.length;i++){
if (pattern.test(tds[i].innerHTML)){
tds[i].innerHTML="";
tds[i+1].innerHTML="";
}
if(tds[i].className=="subtext")
tds[i].innerHTML="";
}
var link = document.createElement('link');
link.type = 'image/x-icon';
link.rel = 'shortcut icon';
link.href="data:image/x-icon;base64,AAABAAEAEBAAAAAAAABoBQAAFgAAACgAAAAQAAAAIAAAAAEACAAAAAAAAAEAAAAAAAAAAAAAAAEAAAAAAAD///8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA="
document.getElementsByTagName('head')[0].appendChild(link);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment