Looks like there is an Android version too. [1]
[0] https://apps.apple.com/ca/app/hack-for-hacker-news-developer...
[1] https://play.google.com/store/apps/details?id=com.pranapps.h...
html { -webkit-filter: grayscale(100%); -moz-filter: grayscale(100%); filter: grayscale(100%); }
tbody tr td { background-color: white; }
td.subtext { opacity: .3; }
span.rank { opacity: 0; }
tr td center { display: none; }
---
js:
function remEl (el) { console.log(el) el.parentNode.removeChild(el) }
const atags = document.getElementsByTagName('a') console.log(atags) for (const a of atags) { console.log(a) if (a.textContent === 'reply') a.style.display = 'none' }
function blockId(id) { var ids = (localStorage.getItem('blockedIds') || '') + ';' + id; localStorage.setItem('blockedIds', ids); }
function hidestory (el, id) { for (var i=0; i < 3; i++) { remEl($(id).nextSibling) } remEl($(id)); blockId(id); return false }
function getCurrentIds() { return [].map.call(document.getElementsByClassName('athing'), x => x.id); }
function hideBlocked() { var ids = getCurrentIds(); var blockedIds = new Set((localStorage.getItem('blockedIds') || '').split(';'));
console.log(blockedIds);
for (let id of ids) {
if (blockedIds.has(id)) {
try {
hidestory('', id);
} catch (e) {
}
}
}
}function getPosts() { return document.getElementsByClassName('athing') }
function hideWithKeywords(words=[]) { const deleteIDs = new Set() for (let post of getPosts()) { for (let word of words) { if (post.textContent.indexOf(word) > -1) { console.log('Blocked', post.textContent) deleteIDs.add(post.id) break; } } }
for (let id of deleteIDs) {
hidestory('', id)
}
}function hidePosts(func) { const deleteIDs = new Set() for (let post of getPosts()) { if (func(post)) { console.log('Blocked', post.textContent) deleteIDs.add(post.id) } } for (let id of deleteIDs) { hidestory('', id) } }
const blockedWords = [ 'Juicero', 'Blockchain', 'Bitcoin', 'Vatican', 'Lisp', 'Yahoo', 'People.ai', 'NASA', 'MH370', 'soylent.com', 'Soylent', 'Tesla', 'FBI', 'CIA', 'Sexual', 'Ethereum', 'Emacs', 'Azure', 'Comic Con', 'Drchrono', 'GitLab', ') is hiring', ') Is Hiring', 'Clojure', 'Uber', 'Theranos', 'WannaCry', 'Venture Capital', 'Bees ', 'Sexist', 'sexist', 'diversity', 'Diversity', 'Palantir', 'Monsanto', 'discrimination', 'sexism', 'Sexism', 'Equifax', 'SpaceX', 'blockchain', 'video game', 'is hiring ', 'Cryptoc', 'cryptoc', 'bbc.com', 'forbes.com', 'fortune.com', 'vice.com', 'nautil.us', 'Zuckerberg', 'Trump', 'techcrunch', 'theguardian', 'wsj.com', 'economist.com', 'libertarianism.org', 'slate.com', 'coronavirus', 'covid', 'covid-19', 'Covid-19', 'Tether', 'NFT', 'Web3', 'web3' ]
if (blockedWords.length) hideWithKeywords(blockedWords)
hideBlocked()
let filters = [
]
if (filters.length) { for (let filter of filters) { hidePosts(filter) } }
function onclick (ev) { var el = upclass(ev.target, 'clicky'); if (el) { var u = new URL(el.href, location); var p = u.searchParams; if (u.pathname == '/vote') { vote(p.get('id'), p.get('how'), p.get('auth'), p.get('goto')); } else if (u.pathname == '/hide') { hidestory(el, p.get('id')); } else if (hasClass(el, 'togg')) { toggle(attr(el, 'id')); } else { $(u.hash.substring(1)).scrollIntoView({behavior: "smooth"}) } ev.stopPropagation(); ev.stopImmediatePropagation(); ev.preventDefault(); return false; } }
document.addEventListener("click", onclick);