
WWW::Contact::GoogleContactsAPI - Get contacts via Google Contacts Data API

use WWW::Contact;
use Data::Dumper;
my $wc = WWW::Contact->new();
my @contacts = $wc->get_contacts('itsa@gmail.com', 'password');
my $errstr = $wc->errstr;
die $errstr if ($errstr);
print Dumper(\@contacts);

WWW::Contact::GoogleContactsAPI uses the Google Contacts Data API (http://code.google.com/apis/contacts/docs/3.0/reference.html) to retrieve all a user's contacts.

$wc->get_contacts($email, $password)Login to Google using email and password. Fetch all the given user's contacts. Return them as a list or, in a scalar context, as a reference to a list. Each element of the result represents one contact as a reference to a hash with one or more of the following keys (all fields are optional):
nameThe contact's main name as a single string. This may be a person's full name or the name of an organisation.
family_nameA person's family name (surname or last name), usually shared with one or both parents.
given_nameA person's given name (christian name or first name).
nicknameAn alternative name or alias for the contact.
emailsAn ordered list of references to pairs, [$address, $type], where $type is "home", "work", "other" or some custom label and $address is the corresponding e-mail address.
emailThe first address in emails, if any. Deprecated: use $contact->{emails}->[0][0].
addressesAs for emails but $address is a postal addresses, given as a single string.
birthdayThe date of birth in the form YYYY-MM-DD or --MM-DD.
ageThe age in years today, calculated from the date of birth.
eventsAn ordered list of references to pairs, [$date, $type], where $date is the date of the event in the form YYYY-MM-DD and $type is the type of event, e.g. "anniversary".
instant_messengersAn ordered list of references to pairs, [$protocol, $address], where $protocol is one of gtalk, jabber, msn, skype, yahoo and possibly others.
phonesAn ordered list of references to pairs, [$number, $type], where $type is one of home, work, mobile and possibly other values. $number may include punctuation and comments.
updatedThe time when this contact was last modified in the form YYYY-MM-DDTHH:MM:SS.SSSZ where T is a literal "T", SS.SSS is seconds and milliseconds as a decimal and Z indicates the UTC time-zone.
notesArbitrary text.
child, spouse, etc.Relations are returned as references to lists of names (even mother and father).
organisationsAn ordered list of reference to pairs, [$organisation, $type], where $organisation is a body this contact is associated with and $type is the type of relationship.
groupsA reference to a list of group names
Any custom fields not recognised by the module are returned in the output hash with a simple string value.

WWW::Contact, WWW::Mechanize, Net::Google::AuthSub

Fayland Lam, <fayland at gmail.com> Denis Howe, denis.howe=gc@gmail.com

Copyright 2008 Fayland Lam, all rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.