20Jan

Adless: Seedless for Twitter

Posted by Elf Sternberg as Uncategorized

Following up onĀ Seedless, I presentĀ Adless: a Tampermonkey extension that looks for the [Dismiss] button on your Twitter feed’s promoted items and pushes it for you:

// ==UserScript==
// @name         Adless
// @namespace    http://elfsternberg.com/
// @version      0.1
// @description  enter something useful
// @author       Anonymous
// @match        https://twitter.com
// @grant        none
// ==/UserScript==

function adless() {
    var stats = document.querySelectorAll('div.promoted-tweet button.dismiss-btn');
   	var lines = [];
    for(var i = 0, l = stats.length; i < l; ++i) { 
        lines.push(stats.item(i)); 
    }
       
    lines.forEach(function(a) { 
        var e = document.createEvent("MouseEvents");
        e.initEvent('click', true, true);
        a.dispatchEvent(e);
  	});
    
    setTimeout(adless, 1000);
}

setTimeout(adless, 500);

Comment Form

Subscribe to Feed

Categories

Calendar

January 2015
M T W T F S S
« Dec   Feb »
 1234
567891011
12131415161718
19202122232425
262728293031