Export your facebook contacts with email addresses

facebook officesFirst of all a big apology because this method of exporting your Facebook contacts is very cumbersome and has several “odd” requirements.
Nonetheless it is presented here as one (desperate) option to export your Facebook contacts and their contact details such as email address and phone number.
This method can be improved upon and made more automatic but Facebook has a tendency to shut down any scripts and software that export contact details.
So instead I leave it as an exercise to the readers to automate this process and extend it with a possible vCard conversion or Outlook import.
You will need:
* Firefox browser
* The XHTML mobile profile add-on for Firefox
* Able to view option 4 (ie Contacts) when accessing Facebook mobile
* Be able to access the internet from your PC by using your mobile device (eg via Bluetooth or IR)
* A text formatting tool (eg. grep)
The option 4 (Contacts) is ideal for exporting your contact details as it lists email addresses and phone numbers as clear text.
On the web version of Facebook the email addresses are displayed as images and a optical character recognition (OCR) process has to be used to decode the email address.
This OCR process is never perfect and will sometimes result in incorrect contact details.
The idea presented here is that you connect your PC to the Internet via your mobile phone (bluetooth, serial, IR or whatever works for you).
You have installed the XHTML mobile profile in Firefox which will let you visit the mobile version of Facebook (m.facebook.com).
Because you are using your mobile operator, Facebook will assume you are on a mobile device and display the shy option 4, contacts.
Step through your contacts and save each page as a text file locally on your computer.
Last step is to combine the saved text files to a single file and use egrep secret sauce to create a neat comma separated (CSV) file with just names, email addresses and phone numbers.
One regular expression that may get you started would be:
/profile\.php([^>]*)>([^<]*)<\/a><br\/>(<small><a href=\"tel:)?([0-9\.]*)?(\">)?([0-9\.]*)?(<\/a><\/small><br\/>)?<small><a href=\"mailto:([^\"]*)/
The best way to automate the exporting of Facebook contacts would be to write a small application for a mobile device (eg in J2ME) that fetches the information and formats it for export.
Another option would be to use Cygwin tools such as curl and grep to automate the process on your PC.
The j2me application would be most fun to do and I may return to it one fine Sunday afternoon!
[Photo by pshab]

Excerpt from a Playboy interview with Bob Dylan

PLAYBOY: Mistake or not, what made you decide to go the rock-‘n’-roll route?
DYLAN: Carelessness. I lost my one true love. I started drinking. The first thing I know, I’m in a card game. Then I’m in a crap game. I wake up in a pool hall. Then this big Mexican lady drags me off the table, takes me to Philadelphia. She leaves me alone in her house, and it burns down. I wind up in Phoenix. I get a job as a Chinaman. I start working in a dime store, and move in with a 13-year-old girl. Then this big Mexican lady from Philadelphia comes in and burns the house down. I go down to Dallas. I get a job as a “before” in a Charles Atlas “before and after” ad. I move in with a delivery boy who can cook fantastic chili and hot dogs. Then this 13-year-old girl from Phoenix comes and burns the house down. The delivery boy – he ain’t so mild: He gives her the knife, and the next thing I know I’m in Omaha. It’s so cold there, by this time I’m robbing my own bicycles and frying my own fish. I stumble onto some luck and get a job as a carburetor out at the hot-rod races every Thursday night. I move in with a high school teacher who also does a little plumbing on the side, who ain’t much to look at, but who’s built a special kind of refrigerator that can turn newspaper into lettuce. Everything’s going good until that delivery boy shows up and tries to knife me. Needless to say, he burned the house down, and I hit the road. The first guy that picked me up asked me if I wanted to be a star. What could I say?