| 1 | package WWW::Google::Contacts::ContactList; | ||
| 2 | { | ||
| 3 | 17 | $WWW::Google::Contacts::ContactList::VERSION = '0.38'; | |
| 4 | } | ||
| 5 | |||
| 6 | 17 | ▶ | use Moose; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 7 | 17 | ▶ | use WWW::Google::Contacts::Contact; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 8 | |||
| 9 | 17 | extends 'WWW::Google::Contacts::Base'; | |
| 10 | |||
| 11 | 17 | with 'WWW::Google::Contacts::Roles::List'; | |
| 12 | |||
| 13 | sub baseurl { | ||
| 14 | 0 | ▶ | my $self = shift; |
|
Subroutine
baseurl: not called CC=1 SCAR=6.9
Pod
undocumented
| |||
| 15 | 0 | return sprintf( "%s://www.google.com/m8/feeds/contacts/default", | |
| 16 | $self->server->protocol ); | ||
| 17 | } | ||
| 18 | 0 | ▶ | sub element_class { 'WWW::Google::Contacts::Contact' } |
|
Subroutine
element_class: not called CC=1 SCAR=6.9
Pod
undocumented
| |||
| 19 | |||
| 20 | 17 | ▶ | no Moose; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 21 | 17 | __PACKAGE__->meta->make_immutable; | |
| 22 | 17 | 1; | |
| 23 | __END__ | ||
| 24 | |||
| 25 | =head1 SYNOPSIS | ||
| 26 | |||
| 27 | use WWW::Google::Contacts; | ||
| 28 | |||
| 29 | my $google = WWW::Google::Contacts->new( username => "your.username", password => "your.password" ); | ||
| 30 | |||
| 31 | my $contacts = $google->contacts; | ||
| 32 | |||
| 33 | while ( my $cont = $contacts->next ) { | ||
| 34 | print "You got a friend called " . $cont->full_name . "\n"; | ||
| 35 | |||
| 36 | if ( $cont->photo->exists ) { | ||
| 37 | print "And you got a photo of this friend\n"; | ||
| 38 | $contact->photo->to_file( "/tmp/photo.jpg" ); | ||
| 39 | } | ||
| 40 | } | ||
| 41 | |||
| 42 | =head1 METHODS | ||
| 43 | |||
| 44 | =head2 $contacts->next | ||
| 45 | |||
| 46 | Returns the next L<WWW::Google::Contacts::Contact> object | ||
| 47 | |||
| 48 | =head2 $contacts->search( $args ) | ||
| 49 | |||
| 50 | B<WARNING> This is quite slow at the moment, at least if you've got a lot of contacts. | ||
| 51 | |||
| 52 | Given search criteria, will return all your contacts that matches critera. | ||
| 53 | |||
| 54 | my @heroes = $contacts->search({ | ||
| 55 | given_name => "Rutger", | ||
| 56 | family_name => "Hauer", | ||
| 57 | }); | ||
| 58 | |||
| 59 | B<TODO>: Speed up. Make search arguments more flexible ( AND / OR / Regex / ... ). Also, doubt that search on random things like IM addresses work right now.. | ||
| 60 | |||
| 61 | =head1 AUTHOR | ||
| 62 | |||
| 63 | Magnus Erixzon <magnus@erixzon.com> | ||
| 64 | |||
| 65 | =head1 COPYRIGHT AND LICENSE | ||
| 66 | |||
| 67 | This software is copyright (c) 2010 by Magnus Erixzon / Fayland Lam. | ||
| 68 | |||
| 69 | This is free software; you can redistribute it and/or modify it under | ||
| 70 | the same terms as perl itself. | ||
| 71 | |||
| 72 | =cut | ||
| 73 | |||