Created
December 16, 2015 09:12
-
-
Save nicolas-t/8f8fd1e0de0c25a8f83d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name die die die | |
// @namespace twi- | |
// @include https://twitter.com/ | |
// @include http://twitter.com/ | |
// @version 1 | |
// @require http://code.jquery.com/jquery-1.11.0.min.js | |
// @grant none | |
// ==/UserScript== | |
jQuery(document).ready(function(){ | |
var timer = 0; | |
var t = 1000; | |
blackListedWords = ['starwars', 'star wars', 'force awakens']; | |
function blackList(){ | |
jQuery('.js-stream-tweet').each(function(){ | |
var $elem = jQuery(this); | |
var tweet = $elem.find('.js-tweet-text').text().toLowerCase(); | |
jQuery.each(blackListedWords, function(){ | |
if(tweet.indexOf(this) !== -1){ | |
$elem.remove(); | |
} | |
}); | |
}); | |
} | |
blackList(); | |
jQuery('.stream-container').bind('DOMNodeInserted', function(event) { | |
timer = setTimeout(function(){blackList();},t); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment