Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Filter tripfaggotry script

Name: Anonymous 2008-08-22 7:04

Is there any way of changing this greassmonkey script so that it filters out tripfags instead of sage?

http://userscripts.org/scripts/show/2124

Here's the source code:

// ==UserScript==
// @name          4chan Anonymizer
// @description   Make everyone on 4chan appear as Anonymous - remove all names, tripcodes, and emails other than sage
// @include       http://*.4chan.org/*
// ==/UserScript==

(function() {

         // Remove all linkmail (unless they are being used for sage) and postertrip elements

        var toRemove = document.evaluate(
            "//a[@class='linkmail' and @href!='mailto:sage']|//span[@class='postertrip']",
            document,
            null,
            XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE,
            null);

        var element;
       
        for (var i = 0; i < toRemove.snapshotLength; i++) {
            element = toRemove.snapshotItem(i);
            element.parentNode.removeChild(element);
        }
       
        // Set the contents of all postername, commentpostername, and remaining linkmail elements to Anonymous
       
        var posterNames = document.evaluate(
            "//span[@class='postername' or @class='commentpostername']",
            document,
            null,
            XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE,
            null);

        for (var i = 0; i < posterNames.snapshotLength; i++) {
            element = posterNames.snapshotItem(i);
               setPosternameInnerText(element, 'Anonymous');
        }
       
    function setPosternameInnerText(element, text)
    {
           if (typeof element.innerText != 'undefined')
           {
             element.innerText = text;
           }
           else if (element.hasChildNodes)
           {
             var childNode;
             var linkmailFound = 0;
            
             // Go through the child nodes - remove anything that's not a linkmail element.
             // If linkmail element is found, set its inner text; otherwise, create a new
             // text node for the inner text.
            
             for (var i = 0; i < element.childNodes.length; i++)
             {
                 var childNode = element.childNodes[i];
                
                 if ((childNode.nodeType == Node.ELEMENT_NODE) && (childNode.tagName.toLowerCase() == 'a') && (childNode.getAttribute('class').toLowerCase() == 'linkmail'))
                 {
                     setLinkmailInnerText(childNode, text);
                     linkmailFound = 1;
                 }
                 else
                 {
                     element.removeChild(childNode);
                 }
             }
            
             if ((linkmailFound == 0) && element.appendChild)
                 element.appendChild(document.createTextNode(text));
           }
    }
   
    function setLinkmailInnerText(element, text) {
        if (typeof element.innerText != 'undefined')
        {
             element.innerText = text;
           }
           else if (element.hasChildNodes && element.appendChild)
           {
             while (element.hasChildNodes())
             {
                   element.removeChild(element.lastChild);
             }
            
             element.appendChild(document.createTextNode(text));
           }
    }
       
})();

Name: Anonymous 2008-08-24 16:58

>>32
Remove the whole thing.
No one will use that shit for more than 10 minutes, not even you. Even with the original script, you'll get sick of missing out on 10% of the posts. I can't even imagine what it'd be like to miss out on entire threads.

4chan has a lot of problems, but tripfags are the least of its worries.

Name: Anonymous 2008-08-24 19:12

>>38
Earlier in this thread I said I'd be willing to suck dick for this script: >>4

So I've come back here to collect the said dick.

Name: Anonymous 2008-08-24 19:15

>>38
One question about this script. How do I change it so that it only targets one tripfag?

I fail at /prog/....

Name: Anonymous 2008-08-24 19:28

>>43
You fail at javascript. Read SICP, then K&R, and you'll know javascript.

Name: Anonymous 2008-08-24 19:54

>>43
s/!= ''/== '!faggot'/

Name: Anonymous 2010-12-09 12:01


Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List