WWW::Google::Contacts::Contact
version 0.12
use WWW::Google::Contacts; my $google = WWW::Google::Contacts->new( username => "your.username", password => "your.password" ); my $contact = $google->new_contact; $contact->full_name("Emmett Brown");
Writes the contact to your Google account.
Fetches contact details from Google account.
Updates existing contact in your Google account.
Deletes contact from your Google account.
Creates or updates contact, depending on if it already exists
All these attributes are gettable and settable on Contact objects.
$contact->given_name("Arnold");
$contact->additional_name("J");
$contact->family_name("Rimmer");
$contact->name_prefix("Mrs");
$contact->name_suffix("III");
If this is set to what seems like "$given_name $family_name", those attributes will be automatically set.
Explicitly setting all email details:
$contact->email({ type => "work", value => 'shenanigans@example.com', display_name => 'Shenanigans', primary => 1, });
If you're just setting the email value, type will default to "work" and leave other fields empty.
$contact->email( 'smeghead@reddwarf.net' );
To specify several email addresses, you could either
provide them all in an array
$contact->email([ { type => "work", value => 'underpaid@bigcompany.com' }, { type => "home", value => 'angryblogger@someblogsite.com' }, ]);
call add_email
$contact->add_email( 'homer@simpson.name' );
Explicitly setting all phone details:
$contact->phone_number({ type => "mobile", value => "+449812323", });
Just setting the value will set type to default value "mobile".
$contact->phone_number( "+1666666" );
To specify several phone numbers, you could either
$contact->phone_number([ { type => "mobile", value => "12345" }, { type => "home", value => "666" }, ]);
call add_phone_number
$contact->add_phone_number({ type => "home", value => "02078712345" });
You can specify all IM details:
$contact->im({ type => "home", protocol => "MSN", value => 'some.email@example.com', });
Or you can just choose to give the IM address:
$contact->im( 'some.email@example.com' );
Arbitrary notes about your friend.
$contact->notes( "He's a lumberjack, but he's ok" );
Sorry, haven't documented all attributes yet :(
Magnus Erixzon <magnus@erixzon.com>
This software is copyright (c) 2010 by Magnus Erixzon / Fayland Lam.
This is free software; you can redistribute it and/or modify it under the same terms as perl itself.
Fayland Lam <fayland@gmail.com>
This software is copyright (c) 2010 by Fayland Lam.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install WWW::Google::Contacts, copy and paste the appropriate command in to your terminal.
cpanm
cpanm WWW::Google::Contacts
CPAN shell
perl -MCPAN -e shell install WWW::Google::Contacts
For more information on module installation, please visit the detailed CPAN module installation guide.