Block/remove upworthy posts on facebook

Alec Jacobson

March 13, 2014

weblog/

The click-bait site, upworthy, really got to me today so I wrote a quick userscript that removes upworthy.com posts from facebook.

// ==UserScript==
// @name       My Fancy New Userscript
// @namespace  http://use.i.E.your.homepage/
// @version    0.1
// @description  enter something useful
// @match      https://www.facebook.com/
// @copyright  2012+, You
// ==/UserScript==
window.setInterval(function(){kill_upworthy();},5*1000);
function kill_upworthy()
{
    var divs = document.getElementsByClassName('_5jmm _5pat _5uch');
    for(var d=0;d<divs.length;d++)
    {
        if(divs[d].innerHTML.indexOf("upworthy")!=-1)
        {
            divs[d].innerHTML = divs[d].getElementsByClassName("_5pbw")[0].innerHTML+"<hr>Upworthy link removed.";
        }
    }
};
kill_upworthy();

block upworthy from facebook

On Chrome I use the tampermonkey extension.