use WWW::Google::Contacts; my $google = WWW::Google::Contacts->new( username => "your.username", password => "your.password" ); my $contacts = $google->contacts; while ( my $contact = $contacts->next ) { print "You got a friend called " . $contact->full_name . "\n"; if ( $contact->photo->exists ) { print "And you got a photo of this friend\n"; # Save the picture to disk! $contact->photo->to_file( "/opt/images/" . $contact->full_name . ".jpg" ); } else { # Upload a picture for this contact $contact->photo->from_file( "/opt/images/" . $contact->full_name . ".jpg" ); # Remember to update Google $contact->photo->update(); } }
Magnus Erixzon <magnus@erixzon.com>
This software is copyright (c) 2010-2013 by Magnus Erixzon.
This is free software; you can redistribute it and/or modify it under the same terms as perl 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.