views:

3249

answers:

7

most of social networks does this. when you register one of them for example twitter it says why dont you invite your friends from hotmail or yahoo or gmail. and expect us to give our credentials and send those mails. I want to implement same feature in java.

I tried http://code.google.com/p/contactlistimporter but it has a problem with hotmal.

can you suggest me nice another library ?

A: 

You may have to screenscrape this yourself, which is a nightmare. I wrote one for Hotmail several years ago that broke after 6 months b/c of changes Hotmail made. And then my fix broke too.

bpapa
A: 

Why don't you look @ the OpenSocial API?

http://code.google.com/apis/opensocial/
http://code.google.com/p/opensocial-java-client/wiki/GettingStarted
lucas
A: 

Most webmail providers offer an option to export the contacts for backup purposes.

Your application would need to ask for the user's credentials, then it could fetch the contact backup (I suppose it has a more or less generic URL) and parse it.

It will most likely be some form of xml or widely used abook format, both formats meant to be machine readable.

Edit:

For Gmail the url is http://mail.google.com/mail/contacts/data/export, it accepts various parameters to define the format of the exported file (gmail csv, vcard, ...) and the scope of exported contacts.

To use it, your application would have to act as a http client and first have to login using the user's credentials.

Ole
+6  A: 

Each of these email providers has its own API:

There are usually Java samples that you can use to start your work. I've been using Google Data API to successfully download my GMail contacts and Google Docs&Spreadsheets.

There seem to be commercial Java libraries for what you're asking for. Some of them are:

I'm not aware of any open-source Java libraries offering a general access to all of these three email providers. There's one for PHP called Open Inviter which supports 10+ networks (if the big three you mentioned could be considered as such at all).

Also, Plaxo has kicked off an effort called Portable Contacts (and draft specification looks promising) but this is at a very early stage. Anyway, I wouldn't Portable Contacts to solve your problem and that won't happen in the next 6+ months anyway. It's something they're doing to advance their business in backing up peoples' address books, creating a more natural network around it and advancing data portability in general with such a strong competition from Google, Facebook and MySpace.

Other than that, I don't think there's anything feasible at the time of this writing. Otherwise I would find it. ;-)

Cheers!
Shonzilla

Shonzilla
A: 

I think , all other except yahoo contact is easy to do. Yahoo contact you could get from here http://lamdaica.com/demo/seeDemo.aspx?id=3&lang=1 with quite cheap price

lamk45tin3
A: 

you can get complete source and demo here http://phuongho.freevnn.com/index.htm

phuongho
A: 

Try this:

socialauth is a java library that allows importing contacts from Google, Yahoo or Hotmail. http://code.google.com/p/socialauth/

Tarun Nagpal