Taking contact list from hotmail gmail yahoo in java? [closed]

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 ?


Solution 1:

Each of these email providers has its own API:

  • GMail: Google Contacts Data API - Google Contacts API version 3.0
  • Yahoo! Mail: Yahoo! Address Book API - Developer's Guide
  • Hotmail: Windows Live Contacts API Beta - API Reference

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:

  • Contacts Importer from Malasian Octazen that supports 30+ web mails in total (with a price tag of $234US) whereas the version you're looking for would cost $88US.
  • another Contacts Importer from Indian Improsys that supports less "networks" and Java version costs $550.

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

Solution 2:

Try this:

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

Solution 3:

Why don't you look @ the OpenSocial API?

  1. Opensocial
  2. GettingStarted with Opensocial

Solution 4:

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.