MapMyGlobe

Facebook Auto Hide Status Updates

A new Facebook script: this new one enables you to delete all the stories in your mini-feed (like, “Jean-Claude and XXX are now friends.”, cf. the screenshot below). I’m seriously thinking about putting all my scripts into a big Greasemonkey Facebook utility! :)


mini-feed.gif


This one was a bit harder to write. The first reason is that when you click on an item’s cross to delete it, you have to click on another button on a popup to confirm. That could have been done with a timeout, which would leave time to Facebook’s DOM scripting to do its thing.

However, this method doesn’t work. The reason is that Facebook’s minifeed_hide_click(), which is called on cross click, is context-dependent. So, I had to dig through the code for that minifeed_hide_click() function, find the relevant piece of code, and I end up directly calling the Ajax method to perform the request to Facebook’s servers, bypassing the context check.

The final code, that you need to run in http://www.facebook.com/minifeed.php, is the following:

var storys = $$('div.story');
for (var i = 0; i < storys.length; i++){
  var sid = storys[i].id.substr(6);
  ajax=new Ajax();
  ajax.onDone=function(){};
  ajax.onFail=function(){aiert(tx('prf:error-hide-mf'));};
  var post={'hide_ministory_key':sid,'profile_fbid':PROFILE_FBID};
  ajax.post('/ajax/minifeed.php',post,true);
}

3 Responses to “Facebook Auto Hide Status Updates”

  1. Virginia Says:

    How do you run the code on that page? I’m using Safari on a Mac.

  2. Zed Starflight Says:

    http://thefullpint.com/beer-news/2009-pbr-art-contest-winners

  3. พระเครื่อง Says:

    We just like this website shown and that has presented myself a few sort of commitment to succeed for some reason, so thanks.

Leave a Reply