Javascript To Remove All Facebook Apps From Your Account

This is a guest post by Gaganpreet Arora AKA bitgeek.

My Facebook app list was cluttered with useless apps accumulated over the time I had joined Facebook. The worst thing is that Facebook does not allow you to remove multiple apps in one go. You have to select one, confirm on “Are you sure?” first and then click on “Okay” when it is deleted. Very cumbersome. So I wrote a Javascript hack to remove all of the apps in one go.

Warning: This will actually delete all the apps

Step 1

Go to: http://www.facebook.com/editapps.php?v=allowed.

Step 2

Select and copy the complete code below and paste it into the address bar.

javascript:
function postwith (to,p)
{
  var myForm = document.createElement("form");
  myForm.method="post" ; myForm.action = to ;
  for (var k in p)
  {
    var myInput = document.createElement("input") ;
    myInput.setAttribute("name", k) ;
    myInput.setAttribute("value", p[k]);
    myForm.appendChild(myInput) ;
  }
  document.body.appendChild(myForm) ;
  myForm.submit() ;
  document.body.removeChild(myForm) ;
}
 
function getElementsByClassName(classname, node)
{
  if (!node)
  {
    node = document.getElementsByTagName('body')[0];
  }
  var a = [], re = new RegExp('\\b' + classname + '\\b');
  els = node.getElementsByTagName('*');
  for (var i = 0, j = els.length; i < j; i++)
  {
    if ( re.test(els[i].className) )
    { a.push(els[i]); }
  }
  return a;
}
 
var arr = [];
els=document.getElementsByClassName('app_row');
arr['fb_dtsg']=document.getElementsByName('fb_dtsg')[0].value;
arr['remove'] = 1;
arr['post_form_id_source']='AsyncRequest';
arr['post_form_id'] = document.getElementById('post_form_id').value;
arr['app_id']=els[0].id.replace("editapps_allowed_","");
arr['__a'] = 1;
for (i=0; i
<h3><span style="text-decoration: underline;"><strong>Step 3</strong></span></h3>
Press Enter.
 
The browser may get stuck for a few moments if the list is large, so if it does, just wait a bit and it will respond back.
<h3><span style="text-decoration: underline;"><strong>References</strong></span></h3>
Function postwith was taken from <a href="http://mentaljetsam.wordpress.com/2008/06/02/using-javascript-to-post-data-between-pages/">here</a>, and getElementsByClassName was taken from <a href="http://snipplr.com/view/1696/get-elements-by-class-name/">here</a>.
 

How To: Install Javascript Plugin in Eclipse

Today, I installed Eclipse on my Fedora 7 desktop. Everything is fine, but the default Eclipse does not have a plugin for JavaScript. So , I searched a lot on Google and read a lot of reviews about some JavaScript plugins available for Eclipse. And I finally reached the JSEclipse plugin by Adobe Labs. I had a good experience with it. Its great to work with and if you are looking for a javascript plugin for eclipse, just don’t search any more and install it. JSEclipse can be downloaded from here after registering with Adobe. Following are the simple steps to install the JSEclipse.

Launch Eclipse and do as suggested in images.

Step 1 :

Follow this image :

Help Software Updates Find And Install

Step 2:

Select “Search new features to install” and click next.

Search New Features To Install

Step 3:

Click “New archived site” and select the package or zip file you just downloaded from the above link and click open.

Choose New Archived Site

Step 4: Click OK.

Select Local Zip File And Click Open Then Click OK

Step 5: Check the package if not checked and click next.

Click Finish

Step 6: Check the features you want to install and click next.

Select Features To Install And Click Next

Step 7: Accept Terms and conditions and click next.

Accept Terms And Conditions

Step 8: Click finish and when it ask to restart eclipse just click yes.

Click Finish

Step 9: Voila !! JavaScript plugin is installed now. Have fun with it.

Eclipse With Javascript Plugin

PS: A lot of howtos are pending. Will Try to finish them asap 😀