Mar. 19th, 2008

ibneko: (Default)
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.

Expand Cut Tags

No cut tags

Profile

ibneko: (Default)
ibneko

Most Popular Tags

Style Credit

Page generated Jun. 10th, 2025 10:28 pm
Powered by Dreamwidth Studios
January 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 2021