Friday, March 18, 2011

Inviting all your friends to facebook events: update March 2011

Facebook just changed (on march 15th 2011) the way to invite friends to event, so a new script is needed.

The code I came up with is:

Version 1:

javascript:elms=document.getElementsByName("checkableitems[]");for (i=0;i<elms.length;i++){if (elms[i].type="checkbox" )elms[i].click()};

Version 2:

javascript:javascript:var elms=document.getElementsByName("checkableitems[]");for(var count=0;count<elms.length;count++){var t = setTimeout("elms["+count+"].click()",100)}

Since now the facebook system uses lazy loading, only the first 100 friends are selected.
You can prevent this by scrolling to the end of the friend list before applying the script!

As before, the script can take a long time (several minutes for thousands of friends) before actually selecting every friend, so just wait.

If your friends are not too many, you can also create different lists of 100 friends each, and apply the script on each list.

I tested version1 with Chrome, other tested firefox 4 and opera. let me know of problems or better solutions!
Some people reported browser crashes.
The script is probably intensive for a high number of user (i could not test more than 500 :D). In case, try version 2!

I posted 2 version: the first is the "normal" one. The second might be a bit slower, but should avoid browser chrashes (I hope!). I'm still working on a faster version, so check back ;)

How to use it:
Triple click on the script (version1 or version 2) to select it.
Copy (ctr+C) the above script.
Go to the event page and select "invite friends". When the menu opens, select your friend list (or just leave "all friends"). Scroll to the end of the panel, and then past into the url bar the script (ctr+v).
Wait a bit (maybe more than a bit!), and you should find all of your friend selected.
Submit the invite and you're done!
For a guide with screenshots check


  1. code 1 works for me in chrome with osx 10.6.6 with around 5000 invites

  2. Hi there, I tried the 2nd one in Chrome and WinXP Professional and it works, but only for one time! When I want to invite people to another event nothing happens. Got an idea?

  3. Script # 2 worked great ( 3< mins) in firefox 3.6 with 1500+ friends! This is also the only version of this that has worked for me (javascript in url) of all the various scripts floating around the webs. Thanks!

  4. update september 6 2011 2nd code is working on internet explorer takes a while but it works :D

  5. Select all friends on facebook 2011

  6. My browser is only searching the javascript code :/

  7. Still wont work for me on Firefox :(

  8. Did NOT work for me on Chrome. Tried multiple times. Pasted into the Chrome URL box. Hit enter. Then I'm taken to a yahoo search results page with a ton of references to blogs about how to use a similar code. What am I doing wrong?