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-23 15:10

>>19
Your script doesn't seem to be removing their post. All it does is convert their name field to Anonymous.
I'm pretty sure Anonymous of Russian Federation's script, which is the one that was posted, removes the posts. But it's totally pointless to use such a script, unless you enjoy seeing others talking to themselves.

And you don't need a Javascript tutorial. I wrote my Croatia censor without previous Javascript knowledge, I just looked at AoRF's script, looked up the Javascript functions I wanted and figured it out.

You'll never escape /a/ and /jp/.
He got his entire subnet banned from the imageboards. I'm guessing proxying is to much of a bother.

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