Script Summary: export your Facebook friends' phone numbers to your phone / addressbook
To use this script, use Firefox to visit http://www.facebook.com/mobile/?phonebook and click Tools > Greasemonkey > User Script Commands > Export Facebook Phonebook after you login. It will prompt you to login to your Google account. (If you don't have one, you can create a GMail for free.) Choose the option to export to vCard. Congrats, you just exported your Facebook Phonebook.
Of course, you can import this vCard into GMail and use Google Sync to sync it with your phone, computer or both. (See google.com/sync for instructions.) GMail will automatically merge any duplicates. Also, if you have Yahoo! Mail you can import your Facebook contacts' e-mail addresses and then export that last import into a CSV that you can import and merge into your GMail contacts, which you can of course sync to your phone, computer or both with Google Sync. If so, you can use whatever app on your phone you like, such as BookSync, HTC Sense or any combination you like to sync their birthdates and pictures.
I did not write this script. Brad Fitzpatrick wrote it, and http://brad.livejournal.com/2398409.html is where you can read more. I simply added the patch by David Barkhausen, and http://www.google.com/profiles/david.barkhausen is his OpenID. Below is a copy-paste of Brad's original posting.
brad's life - AddressBooker & exporting my Facebook Phonebook by Brad Fitzpatrick
[ website | bradfitz.com ]
[ userinfo | livejournal userinfo ]
[ archive | journal archive ]
AddressBooker & exporting my Facebook Phonebook [Nov. 30th, 2008|09:25 pm]
[ Tags | android, hacks, perlbal, tech ]
This 4-day weekend was awesome for catching up on personal hacking projects. In addition to adding IPv6 support to Perlbal and hacking on my interactive shadow/art wall more, I also worked on a little address book management tool, AddressBooker [source here].
Basically AddressBooker takes a POST of contacts data in JSON form, and does stuff with it, where "stuff" is currently limited to merging it into your Google Contacts. (GMail, Android, etc) This was my experiment in learning GData, AuthSub, and App Engine a bit more.
Anyway, I then wanted to get my Facebook Phonebook exported to my Google Contacts, so it'd sync to my Android phone. I didn't see an export option in Facebook (maybe I missed it?), so I wrote a little GreaseMonkey script instead to automate the whole process:
If you have Firefox and GreaseMonkey, then click the above link and it'll ask if you want to install it. Install it, then go to your Facebook Phonebook (
sorry, no permalink to it), then go into Tools > GreaseMonkey > User Script Commands... > and you'll see Export Facebook Phonebook. That'll then page through your phone book (you should probably start on page 1: it's kinda flaky) and extract the data, and then POST it to AddressBooker for you, which will then guide you through merging it into your Google Contacts.
(And keep in mind I barely know browser stuff or Greasemonkey or Python or App Engine or GData, so patches welcome!... email@example.com, or Github)
Update 2010-06-06: Facebook's markup changed again, but I'm too lazy to go update the script. Patches welcome.