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:
http://bradfitz.com/greasemonkey/facebook_phonebook_export.user.js
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
Enjoy!
(And keep in mind I barely know browser stuff or Greasemonkey or Python or App Engine or GData, so patches welcome!... brad@danga.com, or Github)
Update 2009-05-09: Updated the JavaScript to work with Facebook's new layout.
Update 2010-06-06: Facebook's markup changed again, but I'm too lazy to go update the script. Patches welcome.
← Ctrl ← Alt
Ctrl → Alt →
Thanks!
February 19 2009, 18:28:27 UTC 10 years ago
This rocks!
March 6 2009, 14:59:47 UTC 10 years ago
I wish it would grab the non-number people as well. I have some people's number in my google address book but not their email address. It would be nice to see it as an option.
Thanks for making painful work painless.
Suspended comment
April 14 2009, 21:03:32 UTC 10 years ago
April 25 2009, 14:40:19 UTC 10 years ago
Probably bad timing
May 1 2009, 17:57:21 UTC 10 years ago
Re: Probably bad timing
May 9 2009, 23:31:30 UTC 10 years ago
This is awesome, would love to use it...
May 6 2009, 06:42:53 UTC 10 years ago
Required element 'summary' not found; aborting.I disabled all my other Add-Ons and whatnot, so I dunno. I'm sure this is just something I'm not aware of.
Re: This is awesome, would love to use it...
May 9 2009, 22:34:41 UTC 10 years ago
Error
Anonymous
May 7 2009, 10:28:57 UTC 10 years ago
Thanks for coming up with this, its a great idea and really useful. But whenever I run the GreaseMonkey script I get the message "Required element 'summary' not found; aborting."
Any idea whats gone wrong?
Thanks!
Re: Error
May 9 2009, 22:35:23 UTC 10 years ago
Facebook just changed their markup
May 8 2009, 19:41:25 UTC 10 years ago
I'll check back later — would submit a patch if I knew more Javascript. :)
Thanks for creating this!
Re: Facebook just changed their markup
May 9 2009, 22:35:17 UTC 10 years ago
Re: Facebook just changed their markup
Anonymous
10 years ago
Re: Facebook just changed their markup
Anonymous
10 years ago
Re: Facebook just changed their markup
10 years ago
Deleted comment
Use this to support i18n
Anonymous
May 10 2009, 13:31:24 UTC 10 years ago
10 years ago
I have too many friends?
May 24 2010, 23:37:09 UTC 9 years ago
I have 132 contacts to import. All my data got to the addressbooker site, but when I clicked "merge into your google contacts", I got this error:
Traceback (most recent call last): File "/base/python_runtime/python_lib/versions/1/google/appengine/ext/webapp/__init__.py", line 511, in __call__ handler.get(*groups) File "/base/data/home/apps/addressbooker/1.333372172618947701/addressbooker.py", line 345, in get self.ProcessMerge(method='GET') File "/base/data/home/apps/addressbooker/1.333372172618947701/addressbooker.py", line 431, in ProcessMerge feed = client.Get(full_feed_url, converter=gdata.contacts.ContactsFeedFromString) File "/base/data/home/apps/addressbooker/1.333372172618947701/gdata/service.py", line 700, in Get headers=extra_headers) File "/base/data/home/apps/addressbooker/1.333372172618947701/atom/service.py", line 176, in request data=data, headers=all_headers) File "/base/data/home/apps/addressbooker/1.333372172618947701/gdata/auth.py", line 456, in perform_request return http_client.request(operation, url, data=data, headers=headers) File "/base/data/home/apps/addressbooker/1.333372172618947701/gdata/alt/appengine.py", line 144, in request method=method, headers=all_headers, follow_redirects=False)) File "/base/python_runtime/python_lib/versions/1/google/appengine/api/urlfetch.py", line 241, in fetch return rpc.get_result() File "/base/python_runtime/python_lib/versions/1/google/appengine/api/apiproxy_stub_map.py", line 501, in get_result return self.__get_result_hook(self) File "/base/python_runtime/python_lib/versions/1/google/appengine/api/urlfetch.py", line 338, in _get_fetch_result raise ResponseTooLargeError(result) ResponseTooLargeErrorIs this a limitation of google appengine?
Some patches...
July 3 2010, 22:43:39 UTC 9 years ago
Thanks for creating this script - I used it a couple of years ago with no problems! One of my friends recently lost her contacts on her phone, so decided to use your script again to help her get her contacts back but found that it was not longer working. I've done some debugging and there's a couple of changes to your script that I've made to get it working again (presuming it stopped working because of changes Facebook has made since your last update).
First is on the child loop:
var ffriends = get("FriendsPage_Container");
var children = ffriends.childNodes;
// for (var i = 0; i < children.length; ++i) --Original line of code
for (var i = 1; i < children.length; ++i) { // Changed initial value of i = 1
var child = children[i];
Second one is on the name var:
// Extract the name.
// var name = xpath(child, "descendant::node()/a[@class='UIObjectLi
var name = xpath(child, "descendant::node()/a[@class='UIObjectLi
Also, it should be noted that with if users have already enabled the Sync in the iPhone Facebook app, Facebook will include your non-Facebook contacts in their phonebook, which the script doesn't pick up in its name-grab.
You could probably fix this by changing the name var xpath expression to "descendant::node()/*[@class='UIObjectLi
Cheers!
← Ctrl ← Alt
Ctrl → Alt →
Comments for this post were locked by the author