Igor Tolkov

January 2012

12345678910111213141516171819202122232425262728293031

February 2012

1234567891011121314151617181920212223242526272829

March 2012

12345678910111213141516171819202122232425262728293031

April 2012

123456789101112131415161718192021222324252627282930

May 2012

12345678910111213141516171819202122232425262728293031

June 2012

123456789101112131415161718192021222324252627282930

July 2012

12345678910111213141516171819202122232425262728293031

August 2012

12345678910111213141516171819202122232425262728293031

September 2012

1234567891011121314151617181920212223242526272829

October 2012

12345678910111213141516171819202122232425262728293031

November 2012

123456789101112131415161718192021222324252627282930

December 2012

12345678910111213141516171819202122232425262728293031

Facebook filter update

Earlier I wrote about filtering the massive number of irrelevant social content on Facebook. I do this via a Javascript macro inside the Scriptish plugin for Firefox. After I wrote my initial filters that block sponsored posts and some other irrelevant content, a new generation of viral posts emerged. They’re really easy to recognize because of what they do. Here’s an example:

“These Videos Of Humans Rescuing Animals Will Make You Tear Up”

The title alludes to the reader’s emotions, which is very personal and so directly triggers an emotional response. That causes the reader to become passively defensive and click on the link. It’s the same reason why many of us tend to read things that make us uncomfortable - we already are uncomfortable, before we even open up the article.

Anyway, eventually I got fed up and decided to try to write a filter. I made a change to my filter code to optionally look for a matching regular expression inside a given element. Here it is:

window.setInterval(function(){
    var b = function(t, r){
        var s = document.getElementsByClassName(t);
        for(var i in s){
            var a = s[i]; if(!a.className) continue;
            if(r && !a.innerHTML.match(r))
                continue;
            while(a.className.indexOf("_6ns")==-1) a = a.parentNode;
            a.style.display="none";
       }
    };
    b("collapsed_comments");
    b("uiStreamAdditionalLogging");
    b("_6td");
    b("_6m3", /will \w+ you/i);
}, 500);

P.S. Enjoy the XKCD comic ;)