line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Net::Google::GData; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
# ABSTRACT: Handle basic communication with Google services |
4
|
|
|
|
|
|
|
|
5
|
3
|
|
|
3
|
|
234299
|
use warnings; |
|
3
|
|
|
|
|
14
|
|
|
3
|
|
|
|
|
86
|
|
6
|
3
|
|
|
3
|
|
15
|
use strict; |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
117
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
our $VERSION = '0.03'; # VERSION |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
|
11
|
3
|
|
|
3
|
|
13
|
use Carp; |
|
3
|
|
|
|
|
4
|
|
|
3
|
|
|
|
|
179
|
|
12
|
3
|
|
|
3
|
|
9493
|
use LWP::UserAgent; |
|
3
|
|
|
|
|
231525
|
|
|
3
|
|
|
|
|
130
|
|
13
|
|
|
|
|
|
|
|
14
|
3
|
|
|
3
|
|
35
|
use base qw( Class::Accessor Class::ErrorHandler Net::Google::Authenticate ); |
|
3
|
|
|
|
|
5
|
|
|
3
|
|
|
|
|
2609
|
|
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
__PACKAGE__->mk_accessors( qw( |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
) ); |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
sub new { |
22
|
|
|
|
|
|
|
|
23
|
0
|
|
|
0
|
1
|
|
my ( $class, @data ) = @_; |
24
|
|
|
|
|
|
|
|
25
|
0
|
|
0
|
|
|
|
my $self = bless {}, ref $class || $class; |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
# Set some defaults |
28
|
0
|
0
|
|
|
|
|
$self->accountType( $self->_default_accountType ) |
29
|
|
|
|
|
|
|
or croak $self->errstr; |
30
|
|
|
|
|
|
|
|
31
|
0
|
0
|
|
|
|
|
$self->service( $self->_default_service ) |
32
|
|
|
|
|
|
|
or carp $self->errstr; |
33
|
|
|
|
|
|
|
|
34
|
0
|
|
|
|
|
|
$self->source( 'Base GData Perl Package/' . $VERSION ); |
35
|
|
|
|
|
|
|
|
36
|
0
|
|
|
|
|
|
for ( my $i = 0 ; $i < @data ; $i += 2 ) { |
37
|
|
|
|
|
|
|
|
38
|
0
|
0
|
|
|
|
|
if ( my $method = $self->can( $data[$i] ) ) { |
39
|
|
|
|
|
|
|
|
40
|
0
|
|
|
|
|
|
$self->$method( $data[ $i + 1 ] ); |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
} |
43
|
|
|
|
|
|
|
} |
44
|
|
|
|
|
|
|
|
45
|
0
|
|
|
|
|
|
return $self; |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
} ## end sub new |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
|
50
|
0
|
|
|
0
|
1
|
|
sub GET { } |
51
|
0
|
|
|
0
|
1
|
|
sub POST { } |
52
|
0
|
|
|
0
|
1
|
|
sub PUT { } |
53
|
0
|
|
|
0
|
|
|
sub DELETE { } |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
sub _ua { |
57
|
|
|
|
|
|
|
|
58
|
0
|
|
|
0
|
|
|
my $self = shift; |
59
|
|
|
|
|
|
|
|
60
|
0
|
|
|
|
|
|
my $ua; |
61
|
|
|
|
|
|
|
|
62
|
0
|
0
|
|
|
|
|
unless ( $ua = $self->SUPER::get( '_ua' ) ) { |
63
|
|
|
|
|
|
|
|
64
|
0
|
|
|
|
|
|
$ua = LWP::UserAgent->new; |
65
|
|
|
|
|
|
|
|
66
|
0
|
|
|
|
|
|
$self->SUPER::set( '_ua', $ua ); |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
} |
69
|
|
|
|
|
|
|
|
70
|
0
|
|
|
|
|
|
$ua->agent( $self->source ); |
71
|
|
|
|
|
|
|
|
72
|
0
|
0
|
|
|
|
|
$self->_auth |
73
|
|
|
|
|
|
|
? $ua->default_header( 'Authorization' => 'GoogleLogin auth=' . $self->_auth ) |
74
|
|
|
|
|
|
|
: $ua->default_headers->remove_header( 'Authorization' ); |
75
|
|
|
|
|
|
|
|
76
|
0
|
|
|
|
|
|
return $ua; |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
} ## end sub _ua |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
1; # End of Net::Google::GData |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
__END__ |