// ==UserScript== // @name Pinkbike comment and article filter // @namespace Violentmonkey Scripts // @include http://www.pinkbike.com/* // @include https://www.pinkbike.com/* // @version 1.2 // ==/UserScript== /*** start of settings ***************************************/ // Configure which users to block. // // Add the unsernames you want to block by enclosing them in single quotes, separated by a comma. // // -- Example -- // // Suppose a user 'Billy Bob' has profile url "https://www.pinkbike.com/u/BillyBob/" // then use: // // var userNames = ['BillyBob']; // // When you want to block users with url "https://www.pinkbike.com/u/johnny3000/" and // "https://www.pinkbike.com/u/mtbderp/" too, then use: // // var userNames = ['BillyBob','johnny3000','mtbderp']; // var userNames = ['']; // toggle to hide replies to commments by blocked users: true for yes, false for no. var filterReplies = true; // Configure which articles to block. // // Add the tags you want to block by enclosing them in single quotes, separated by a comma. // // -- Example -- // // If you want to hide front-page articles which have a tag that links to urls // 'https://www.pinkbike.com/news/tags/emtb/' and/or 'https://www.pinkbike.com/news/tags/contests-and-deals/' , // then use: // // var tags = ['emtb','contests-and-deals']; // var tags = ['']; // when set to 'true' don't filter anything but show a red outline around articles and comments that would be filtered. var testmode = false; /**** end of settings ****************************************/ var i = 0; var ii = 0; var iii = 0; var articles, tagsInArticle, tagUrl; function hideElement(domElement){ if (testmode === true){ domElement.style.border = '2px solid red'; }else{ domElement.style.display = 'none'; } } // hide articles by tags if (articles = document.getElementById('news-container')){ articles = articles.getElementsByClassName('news-style1'); for (i=0;i < articles.length; i++){ tagsInArticle = articles[i].querySelectorAll('.pb-tag'); for ( ii=0;ii