// ==UserScript==
// @name           FriendFeed Savior
// @namespace      bjornstar
// @description    Hide items that contain words you don't want to see.
// @include        http://beta.friendfeed.com/
// @include        http://beta.friendfeed.com/*
// @include        http://friendfeed.com/
// @include        http://friendfeed.com/*
// ==/UserScript==

function needstobesaved(){
  var theList = new Array('formalista', 'filmfeed', 'fffound', 'vi.sualize.us');
  for(var i=0;i<theList.length;i++) {
    var currentVal = unsafeWindow.$(this).html();
    if(currentVal.toLowerCase().indexOf(theList[i])>=0) {
      unsafeWindow.$(this).attr("id", unsafeWindow.$(this).attr("eid"));
      var save_id = unsafeWindow.$(this).attr("id");

      var filtered_div = document.getElementById(save_id);

      var div_notice = document.createElement('div');
      div_notice.className = 'entry';
      div_notice.innerHTML = 'You have been saved from this post, it had something you didn\'t want to see in it.<br /><a onclick="this.parentNode.style.display=\'none\'; this.parentNode.nextSibling.style.display=\'\'; return false;" href="#"><i>Click here</i></a> if you cannot resist the temptation.';
      
      filtered_div.parentNode.insertBefore(div_notice, filtered_div);

      unsafeWindow.$(this).css("display", "none");
      return
    }
  }
}

unsafeWindow.$("div.entry").each( needstobesaved );

