views:

536

answers:

7

Does anyone know of a Webmail Contact List Importer scripts (ColdFusion, PHP etc) like those used on Twitter and LinkedIn ? I've found some but they are paid for and I want some more bespoke & open.

To clarify a little more I'm not looking for a way to process .csv files :) I'm looking for a bit of code that can logging into gmail, yahoo mail, hotmail, aol and pull out the users address book.

A: 

What format does it use for contact list? If CSV, then you can write it in 1 minute...

$data = file('list.csv');
$contacts = array();
foreach ($data AS $entry)
{
    $contacts[] = explode($separator, $entry); // usually separator is ';'
}

add here error handling and name the fields after exploding - and that's it!

Jet
+3  A: 

Are you actually after a method where a user enters their webmail username and password into your site and then your site goes off and grabs contact details from that account? If so, then it sounds like a can of worms to me, and is something that our very own Mr Atwood blogged about a while back.

I'd go with something along the lines of Evgeniy's answer.

(I would have just commented on the question but my woeful rep prevents me...)

(Edited to include the link to Jeff's blog now that I'm allowed)

Matt
You can't add a hyperlink? You should be able to... Anyway, this is the page you're referencing: http://www.codinghorror.com/blog/archives/000953.html
Adam Tuttle
That's the fella - thanks.I suspect 'new user' status is defined by your rep, since even though I joined 8 months ago I still get the 'new users can't add hyperlinks' message. Oh well, best get answering more questions :-)
Matt
Is there any reason Andy would need to store the password? Or could his webpage submit to the backend and then be passed through to the api and discarded? I'm not sure that's critical.
Antony
No, none at all. But the issue is that it's one more instance where a user's password *could* be compromised. What about Andy's log files? If he were to use a 3rd party library, how can he be sure the library treats his users' passwords securely? What if he's *really* unlucky and chooses an evil library which secretly calls home with users' passwords?Lots of ifs and maybes, but they were the kind of worms I was thinking about.
Matt
Very good points - thanks Matt
Antony
A: 

What format does it use for contact list? If CSV, then you can write it in 10 seconds...

<cfhttp
    url  = "http://localhost/list.csv"
    name = "Contacts"
/>

And that handles all the escaping and column naming for you, giving a nice convenience Query to work with.

;)

Peter Boughton
+1  A: 

You will likely need to use a library that can log into all of those services, and access their contact lists in their format, and extract them in one format.

In other news, The PHP/Curl book seems to have it all done for $25 cost of the book. I would suspect whatever the code is in PHP, it would be about half with Coldfusion.

Jas Panesar
+1  A: 

try http://openinviter.com/, has the email contact import plus a few social networks built in

Jason
A: 

probabily you can try http://stescodes.com/grabcontacts.aspx, it has demo too

it has linkedin and myspace

stescodes
A: 

StesCodes Contact Grabber have services for Gmail, Yahoo, MSN, Hotmail, AOL, AIM, Mail.com, Orkut, Myspace, Facebook, Google wave, Plaxo, Bigstring, Msn Messenger, Opera, kodak, evite, pingg, rediffmail, fastmail and more...

Also have application grabbing services for Outlook CSV, Outlook Express CSV, Thunderbird CSV, Google CSV, Yahoo CSV, Windows live CSV.

Click here to play with the DEMO and SOURCE CODE

  1. Stescodes uses no exe’s
  2. StesCodes uses no user redirection for permission
  3. StesCode source code will work both in shared and dedicated servers
  4. StesCodes provides code update
  5. 100% UI customizable
  6. Uses no OAuth

Source code available in Asp.net, VB.net, WinForms and Webservices for Framework 3.5 and 4.0

navin