Close
0%
0%

UserScript to blacklist tags on hackaday.com

A simple UserScript for GreaseMonkey / TamperMonkey that will delete articles from hackaday.com/* that contain any of the blacklisted tags.

Similar projects worth following
Pretty simple, change the blacklist_tags to the articles you do not wish to see anymore.

Alternatively, stop bitching about the articles and just keep scrolling.

// ==UserScript==
// @name         Blacklist Tags
// @namespace    http://www.google.com/
// @version      0.1
// @description  Change the blacklist_tags array to suit
// @author       dddanmar
// @match        http://hackaday.com/*
// @grant        none
// ==/UserScript==

var articles = document.getElementsByTagName("article");
var blacklist_tags = ["crowd-funding", "crowdfunding", "kickstarter", "indiegogo",]
for(var i = 0; i < articles.length; i++){
   tag_blocks = articles[i].getElementsByClassName("tags-links");
   for (var a = 0; a < tag_blocks.length; a++) {
        tags = tag_blocks[a].getElementsByTagName("a");
        for (var b = 0; b < tags.length; b++) {
                tag_link = tags[b].href
                for (var c = 0; c < blacklist_tags.length; c++){
                        if (tag_link.indexOf(blacklist_tags[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")
                        }
                }
        }
   }
}

  • More - Blacklisting an Author

    Daniel Ward04/07/2015 at 03:19 1 comment

    And 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")
           }
       
       }
    }

View project log

Enjoy this project?

Share

Discussions

RoGeorge wrote 04/06/2015 at 08:13 point

And if someone wants to see an empty black screen, just add "Arduino" to the blacklist_tags.
:o)

  Are you sure? yes | no

syntroniks wrote 04/07/2015 at 02:44 point

YES! Thank you and nice code

  Are you sure? yes | no

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates