-
-
Save scott113341/56c03bc7f285eefbea0a6146bcb59134 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const banned = [ | |
/^medium\.com$/, | |
/^bloomberg\.com$/, | |
/^wired\.com$/, | |
/^bbc\.com$/, | |
/^bbc\.co\.uk/, | |
/^slate\.com$/, | |
/^techcrunch\.com$/, | |
/^lifehacker\.com$/, | |
/^washingtonpost\.com$/, | |
/^nytimes\.com$/, | |
/^theregister\.co\.uk$/, | |
/^vice\.com$/, | |
/^wsj\.com$/, | |
/^forbes\.com$/, | |
/^independent\.co\.uk$/, | |
/^thehill\.com$/, | |
/^npr\.org$/, | |
/^engadget\.com$/, | |
/^businessinsider\.com$/, | |
/^9to5mac\.com$/, | |
/^theguardian\.com$/, | |
/^theverge\.com$/, | |
/^economist\.com$/, | |
/^gizmodo\.com$/, | |
/^qz\.com$/, | |
/^theatlantic\.com$/, | |
/^buzzfeed\.com$/, | |
/^twitter\.com$/, | |
/^wired\.co\.uk$/, | |
/^aeon\.co$/, | |
/^nautil\.us$/, | |
/^atlasobscura\.com$/, | |
/^vox\.com$/, | |
/^nymag\.com$/, | |
/^mashable\.com$/, | |
/^newyorker\.com$/, | |
/^hackernoon\.com$/, | |
/^cnbc\.com$/, | |
/^buzzfeednews\.com$/, | |
]; | |
const rows = Array.from(document.querySelectorAll('#hnmain .itemlist tr')); | |
rows.forEach((row, i) => { | |
if (row.className !== 'athing') return; | |
const site = row.querySelector('.sitestr'); | |
if (site && banned.find(b => b.test(site.innerText))) { | |
console.log(`removing ${site.innerText}`); | |
row.remove(); | |
rows[i + 1].remove(); | |
rows[i + 2].remove(); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment