26 Apr 2011

Inviting all friends to a Facebook event

Selecting all Facebook contacts one by one before sending an invitation to an event takes a big effort and large doses of patience.

After a quick google powered search for some insight on the procedure I came up with this little script which does the trick of selecting all the contacts for you.

This involves three simple steps:


  1. Open the contacts dialog 'Select guests to invite'
  2. Scroll to the bottom of the contacts list to make sure all contacts are loaded
  3. Copy and paste this javascript code to your browser's location toolbar

javascript:(function(){
  var elms=document.getElementsByName("checkableitems[]");
  for(var count=0;count<elms.length;count++){
   elms[count].click();
   var d = new Date();
   var n;
   var diff = 0;
   while(diff < 10) {n = new Date(); diff = n.getTime()- d.getTime();}
  }
})();

  1. Hit enter and wait for the code to execute and select all your contacts. Note that it takes approximately 1 second for each 100 contacts in your list.
  2. Click on the 'Submit' button and all your Facebook friends will receive the event invitation

This code was verified to work with Firefox and Chrome web browsers with Facebook actual version.

No comments: