tags:

views:

1169

answers:

8

a lot of websites like twitter, facebook and others let the users enter their email id and pwd and 'extract' the contacts based on that.

Anyone know how this is done?

+3  A: 

They login to your account and scrape the contents, or use a public API. Either way, it's not a method that I would implement or use myself because I wouldn't trust anyone else with my credentials. And I think it teaches users to be careless with the secrecy of their credentials.

Forgotten Semicolon
This answer doesn't address the question asked by the poster, so IMO it's unfortunate that it's the highest ranked.
Don
There is no answer marked as correct. Please share one that addresses the question, then.
Forgotten Semicolon
I already have :)
Don
A: 

I assume they log into your email account, either by POP3, a public API or they know the html formatting of webmail systems and read the DOM. Then they find whoever you recieved and sent emails to and looks through it's own user database to find matches.

RobbieGee
A: 

yeah, I agree. trusting a site with your email credentials isnt safe. Especially after what was found by gmail archiver (http://it.slashdot.org/article.pl?sid=08/03/11/1723206&from=rss)

But just from programmatic POV I was wondering how they did this. maybe Gmail hotmail and all others do have API's which users can use....need to look into it more i guess.

+3  A: 

Leaving aside the ethical questions, there's a commercial library available that can do this for you: http://www.octazen.com/product_abimporter.php

The library is available for PHP, .NET, Java, Ruby & ColdFusion. It supports importing contacts from dozens of different services (including all the main ones).

It only costs about $100 for a licence, works perfectly and (using the Java version) only requires this single line of code to import contacts from any of the supported services:

List<Contact> contacts = SimpleAddressBookImporter.fetchContacts(emailAddress, password)

They have another library that can import friend lists from social networks, though I haven't tried that one.

Don
A: 

This is the sort of thing OAuth was designed for. Google have started to adopt it. It doesn't have the same trust issues as the more typical scraping.

Unfortunately, for the time being, people tend to just ask for your password, log in as you, and scrape the information, which is far less secure, as it gives the website total access to your account. This isn't something you should copy, use OAuth or an equivalent wherever possible.

Jim
+1  A: 

There are APis available:

Yahoo --> http://developer.yahoo.com/addressbook/

Google --> http://code.google.com/apis/contacts/

None for AOL (yet).

A: 

Free source code available in ASP.NET to import contacts from Yahoo, Gmail, Hotmail and AOL. Does anyone know how to do this with Facebook?

this is a dead link
tentonipete