// ==UserScript== // @name MC forum Spam Blocker // @namespace Ian.M // @description Hides specific spam in forum topic lists // @include http://www.microchip.com/forums/* // @version 2.2a // ==/UserScript== function hideSpamByXPath(partXPath) { var snapResults=document.evaluate( "//table[@class='maintable']/" + partXPath + "/ancestor::tr[@class]", document, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null); for (var i = snapResults.snapshotLength - 1; i >= 0; i--) { var elm = snapResults.snapshotItem(i); // do stuff with elm // elm.style.display = "none"; //Hide the spam elm.parentNode.removeChild(elm); //Delete the spam to reduce parsing time for next search } } //// Kill topics with individual spam phrases in first post body (@title is hover text only, . is anchor text) //// hideSpamByXPath("descendant::a[contains(@title,'*PASTE*HERE*')]"); //// match Vashikaran or vashikaran in topic name or preview hideSpamByXPath("descendant::a[contains(.,'ashikaran')]"); hideSpamByXPath("descendant::a[contains(@title,'ashikaran')]"); //// block spams by phone number! hideSpamByXPath("descendant::a[contains(@title,'7742228242')]"); hideSpamByXPath("descendant::a[contains(@title,'8566081000')]"); hideSpamByXPath("descendant::a[contains(@title,'9680801434')]"); hideSpamByXPath("descendant::a[contains(@title,'9815331734')]"); hideSpamByXPath("descendant::a[contains(@title,'9829791419')]"); hideSpamByXPath("descendant::a[contains(@title,'9950211818')]"); hideSpamByXPath("descendant::a[contains(.,'7073249310')]"); hideSpamByXPath("descendant::a[contains(.,'9646410026')]"); hideSpamByXPath("descendant::a[contains(.,'9694850756')]"); hideSpamByXPath("descendant::a[contains(.,'\u2792\u2791\u2790\u278c\u278c\u278f\u2790\u2790\u278e\u278d')]"); // graphic inverse (9)(8)(7)(3)(3)(6)(7)(7)(5)(4) // Add more lines changing the text in '' (not "" - that's the partial XPath) to match other spam contents.