Last active
December 22, 2015 18:29
-
-
Save nicolas-t/6513306 to your computer and use it in GitHub Desktop.
black list apple keynote words from your twitter stream
This file contains 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 no apple | |
// @namespace twi- | |
// @include https://twitter.com/ | |
// @include http://twitter.com/ | |
// @version 1 | |
// @require https://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js | |
// @grant none | |
// ==/UserScript== | |
jQuery(document).ready(function(){ | |
var timer = 0; | |
var t = 1000; | |
blackListedWords = ['apple', 'keynote', 'iphone', 'ipod', 'ipad', 'steve jobs', 'applelive']; | |
function clean(){ | |
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(); | |
} | |
}); | |
}); | |
} | |
jQuery('.stream-container').bind('DOMNodeInserted', function() { | |
timer = setTimeout(function(){clean();},t); | |
}); | |
clean(); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment