Skip to content

Instantly share code, notes, and snippets.

@erik-megarad
Created March 10, 2014 20:00
Show Gist options
  • Save erik-megarad/9473059 to your computer and use it in GitHub Desktop.
Save erik-megarad/9473059 to your computer and use it in GitHub Desktop.
Filter out annoying news stories
// ==UserScript==
// @name Google News Filter
// @namespace erik@subwindow.com
// @description filter out annoying news stories
// @include http://news.google.com/*
// @include https://news.google.com/*
// ==/UserScript==
(function () {
var regexes = [
/pistorius/gi,
/sandy hook/gi,
/lanza/gi
];
tables = document.getElementsByClassName('esc-layout-table');
Array.prototype.slice.call(tables).forEach(function(table, i, a) {
regexes.forEach(function(regex, i, a) {
if(table.innerText.match(regex)) {
table.style.display = 'none';
}
});
});
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment