-
More - Blacklisting an Author
04/07/2015 at 03:19 • 1 commentAnd to blacklist authors:
// ==UserScript== // @name Blacklist Authors // @namespace http://www.google.com/ // @version 0.1 // @description Change the blacklist_authors array to suit // @author dddanmar // @match http://hackaday.com/* // @grant none // ==/UserScript== var articles = document.getElementsByTagName("article"); var blacklist_authors = ["brianbenchoff"] for(var i = 0; i < articles.length; i++){ author = articles[i].getElementsByClassName("author"); console.log(author[0].href) for (var c = 0; c < blacklist_authors.length; c++){ if (author[0].href.indexOf(blacklist_authors[c]) > -1 ) { console.log("Removing Article") console.log(articles[i]) try { articles[i].remove(); } catch(err) {console.log("Article does not exist")} console.log("Article removed") } } }