Skip to content

Instantly share code, notes, and snippets.

@nicolas-t
Created March 5, 2014 10:57
Show Gist options
  • Select an option

  • Save nicolas-t/9365130 to your computer and use it in GitHub Desktop.

Select an option

Save nicolas-t/9365130 to your computer and use it in GitHub Desktop.

Revisions

  1. nicolas-t created this gist Mar 5, 2014.
    37 changes: 37 additions & 0 deletions noselfie.user.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,37 @@
    // ==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 = ['selfie'];

    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);
    });
    });