Skip to content

Instantly share code, notes, and snippets.

@scott113341
Created October 5, 2018 21:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save scott113341/56c03bc7f285eefbea0a6146bcb59134 to your computer and use it in GitHub Desktop.
Save scott113341/56c03bc7f285eefbea0a6146bcb59134 to your computer and use it in GitHub Desktop.
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