Benjamin Juang (ibneko) wrote,
Benjamin Juang
ibneko

  • Mood:
  • Music:

Facebook quick-friend-accept-script

Because when you have 30+ new friends on facebook, all from one source, and you _reaaaally_ don't want to slowly accept each and every one:

copy/paste into your browser address bar:
set them all to friend list 1 (limited profile)
javascript:list = document.getElementById('friend_add_main').parentNode.childNodes;for(var i=1; i<list.length; i++) {    id = list[i].id.substr(6);        document.getElementById("add_to_friend_list_widget_select_"+id).selectedIndex = 1;document.getElementById("add_to_friend_list_widget_select_"+id).onchange();}

Then Accept everyone.
javascript:list = document.getElementById('friend_add_main').parentNode.childNodes;for(var i=1; i<list.length; i++) {    id = list[i].id.substr(6);        click_add_friend(id, 0, 0, '', 'accept', 'Confirm', 'Does Not Attend', 'I Don\'t Know');}

Or you can do it all in one step, if you're only doing one, limited profile list (I did 2 per person, so..):
javascript:list = document.getElementById('friend_add_main').parentNode.childNodes;for(var i=1; i<list.length; i++) {    id = list[i].id.substr(6);        document.getElementById("add_to_friend_list_widget_select_"+id).selectedIndex = 1;document.getElementById("add_to_friend_list_widget_select_"+id).onchange();click_add_friend(id, 0, 0, '', 'accept', 'Confirm', 'Does Not Attend', 'I Don\'t Know');}


Here's the code, reformatted to read nicer:
javascript:
list = document.getElementById('friend_add_main').parentNode.childNodes;
for(var i=1; i<list.length; i++)
{
    id = list[i].id.substr(6);
    document.getElementById("add_to_friend_list_widget_select_"+id).selectedIndex = 1;
    document.getElementById("add_to_friend_list_widget_select_"+id).onchange();
    click_add_friend(id, 0, 0, '', 'accept', 'Confirm', 'Does Not Attend', 'I Don\'t Know');
}


Props to TJ M. for coming up with most of it. I was being relatively lazy.
Tags: facebook, javascript
Subscribe
  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 1 comment