NOTICE: By continued use of this site you understand and agree to the binding Terms of Service and Privacy Policy.
// ==UserScript== // @name RB Forum Filter // @namespace ratebeer.com // @description Removes posts and replies by specified users // @include http://www.ratebeer.com/forums* // @include http://ratebeer.com/forums* // @author 3fourths // ==/UserScript== var IgnoreName = new Array(); // Change and add your own usernames to ignore. // Be sure to leave off the comma after the last element. // // For example: IgnoreName = [ 'UserName1', 'UserName2', 'UserName3' ] IgnoreName =[ 'Tibeerious' ]; RegExp.quote = function(str) { return str.replace(/(?=[\\^$*+?.()|{}[\]])/g, "\\"); } // loop through names for (i = 0; i < IgnoreName.length; i++) { // remove replies in topics var ForumReplies = document.evaluate('//tr/td/img[@src="http://res.cloudinary.com/ratebeer/image/upload/w_50,h_50,c_fit,d_user_def.gif/user_' + IgnoreName[i] + '.jpg"]',document,null,XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE,null); for (j = 0; j < ForumReplies.snapshotLength; j++) { (foo = ForumReplies.snapshotItem(j).parentNode.parentNode).parentNode.removeChild(foo); } // remove replies to replies by poster. var allElements = document.evaluate('//tr/td/div', document, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null); for (var j = 0; j < allElements.snapshotLength; j++) { thisElement = allElements.snapshotItem(j); if(thisElement.innerHTML.search(RegExp("\\b(" + RegExp.quote(IgnoreName[i]) + ")", "gi"))>=0) { thisElement.parentNode.parentNode.style.display="none"; } } // remove threads started from main page ForumTopics = document.evaluate('//tr/td/a[@title="View ' + IgnoreName[i] + '\'s Profile"]',document,null,XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE,null) for (j = 0; j < ForumTopics.snapshotLength; j++) { (foo = ForumTopics.snapshotItem(j).parentNode.parentNode).parentNode.removeChild(foo) } }