Created
March 10, 2014 20:00
-
-
Save erik-megarad/9473059 to your computer and use it in GitHub Desktop.
Filter out annoying news stories
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
// ==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