How to invite all your Facebook friends to an event at once (code has changed)


In the last few days, Facebook has changed the “invite your friends” functionality, which powers suggestions and invitations to events, groups, pages, etc.

The result is that old Javascript codes that allowed you to invite ALL your Facebook friends to an event in a snap (such as this) are now broken.

To select all your new friends in the new interface you can use this code, tested under Safari 5.0.4, Chrome 10 and Firefox 4 (should work also under IE).
UPDATE: There are many reports of it working on newer versions in the comments below.

javascript:var x=document.getElementsByTagName("input");for(var i=0;i<x.length;i++) {if (x[i].type == 'checkbox') {x[i].click();}}; alert('Done, all your friends have been selected');

In order to use this code, copy and paste it in the address bar of your browser after you have opened the “invite your friends” dialog and AFTER YOU HAVE SCROLLED DOWN THE LIST.

Important note: as said, you HAVE to scroll down your friends list in order to invite all your friends: in fact the new interface only loads few friends via AJAX at a given time.

Facebook should definitely be a little more open regarding MY data, loaded on their systems… and this script opens it just a bit more.

DISCLAIMER: I DO NOT ASSUME ANY RESPONSIBILITY WHATSOEVER FOR THE USAGE OF THIS CODE; IF YOU GET BANNED BY FACEBOOK, OR ANYTHING ELSE, YOU WILL BE CLAIMED THE SOLE RESPONSIBLE FOR SUCH ACTIONS.

  1. #1 by Garvito on 16/04/2012 - 20:57

    For some reason script won’t work.
    :(
    Will attempt again & again.

  2. #2 by rohan gautam on 18/04/2012 - 06:18

    THANKS and please join my page
    1) facebook.com/7ganesha
    2) facebook .com/prayjesus
    and ADD me on facebook
    http://www.facebook.com/gautam.rohan

  3. #3 by mike everidge on 24/04/2012 - 10:10

    hi

  4. #4 by rebecca in OK on 26/04/2012 - 04:46

    YEA! You are a life saver!!! I use this every time now. THANK YOU!!

  5. #5 by Surfrat on 27/04/2012 - 07:01

    Works Perfect, You Just have to give it some time when you have thousands of friends, :)

  6. #6 by Ron Rizzle on 27/04/2012 - 23:47

    Where do I enter the script?

  7. #7 by Breezy on 01/05/2012 - 20:40

    I followed your instructions. I hit “Invite Friends”, scrolled to the bottom of my friend list (approx. 4700 people), and then I pasted the code into my address bar (using Firefox 12.0)… nothing happened (even after 30 minutes). Any suggestions?

  8. #8 by mmeFrouFrou on 03/05/2012 - 01:48

    Hey! I created an event in my fb and invited my friends using this, it worked and invited my 300 or so mates. Then I logged in under my DJ name and accepted the event invite, then invited my 6000 friends. The code worked, it eventually selected all of my friends, I sent the invite, FB asked me to add a Captcha code, I did… then it thought about it a bit and came up with the conclusion ‘you don’t have sufficient permissions to do that’. Imagine if I had’ve spent 3 days selecting those 6000 by hand… Bloody fb.

  9. #9 by pocketrocket on 07/05/2012 - 13:29

    hey guys this isn’t working for me on Safari, FF or Chrome – tried every code going now and nothing! FF it doesn’t select anything and on the others it does the job then I get the annoying “narrow friends” message.. Grrr!

    My work is event promotion based so this is just doing my head in now – all the other old tricks – better facebook, Greasemonkey etc not working now either. I have 5k friends on 1 account and 2 other with about 600 friends each. If ANYONE has any other ways round please please let me know as this is totally affecting my business! cheers! :-D

  10. #10 by Pepa on 08/05/2012 - 02:16

    Thank you Marco !! You are fantastic!!
    Soy de un grupo musical de Valencia, gracias a ti, podremos invitar a los fans a nuestras actuaciones de un solo click!! Me has ahorrado mucho tiempo. MIL GRACIAS desde EspaƱa (Valencia)!!!
    Saludos, Pepa

  11. #12 by ben on 08/05/2012 - 14:37

    var x = document.querySelectorAll(‘.fbProfileBrowserListContainer input[type="checkbox"]‘);for(var i=0;i<x.length;i++) x[i].click(); alert('Done');

    Use that instead, should work.

  12. #13 by 60Hz on 10/05/2012 - 07:09

    Some things i noticed:
    1. If you copy into chrome, make sure it pastes the “javascript:” part, if it didn’t you’ll have to type that in at the start… otherwise it may not work…

    2. also it takes awhile if you have large number of friends…

    3. and as he says in the description, scroll down to load all the names (this may also take awhile if you have a long list)…

    anyway thanks for the script! I have no idea why FB doesn’t already do this…

  13. #14 by Genuineapps on 14/05/2012 - 12:10

    Thanks !!!!

  14. #15 by Drumbum on 17/05/2012 - 05:16

    code worked for me on IE.. tyvm Marco

1 25 26 27
(will not be published)