| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package WebService::Gravatar; |
|
2
|
|
|
|
|
|
|
|
|
3
|
2
|
|
|
2
|
|
36768
|
use warnings; |
|
|
2
|
|
|
|
|
5
|
|
|
|
2
|
|
|
|
|
62
|
|
|
4
|
2
|
|
|
2
|
|
10
|
use strict; |
|
|
2
|
|
|
|
|
5
|
|
|
|
2
|
|
|
|
|
58
|
|
|
5
|
|
|
|
|
|
|
|
|
6
|
2
|
|
|
2
|
|
32
|
use Carp; |
|
|
2
|
|
|
|
|
8
|
|
|
|
2
|
|
|
|
|
186
|
|
|
7
|
2
|
|
|
2
|
|
12
|
use Digest::MD5 qw/md5_hex/; |
|
|
2
|
|
|
|
|
4
|
|
|
|
2
|
|
|
|
|
136
|
|
|
8
|
2
|
|
|
2
|
|
818
|
use RPC::XML::Client; |
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
=head1 NAME |
|
11
|
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
WebService::Gravatar - Perl interface to Gravatar API |
|
13
|
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
=head1 VERSION |
|
15
|
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
Version 0.11 |
|
17
|
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
=cut |
|
19
|
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
our $VERSION = '0.11'; |
|
21
|
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
=head1 SYNOPSIS |
|
24
|
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
WebService::Gravatar provides an interface to Gravatar XML-RPC API. |
|
26
|
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
use WebService::Gravatar; |
|
28
|
|
|
|
|
|
|
use MIME::Base64; |
|
29
|
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
# Create a new instance of WebService::Gravatar |
|
31
|
|
|
|
|
|
|
my $grav = WebService::Gravatar->new(email => 'your@email.address', |
|
32
|
|
|
|
|
|
|
apikey => 'your_API_key'); |
|
33
|
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
# Get a list of addresses |
|
35
|
|
|
|
|
|
|
my $addresses = $grav->addresses; |
|
36
|
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
if (defined $addresses) { |
|
38
|
|
|
|
|
|
|
# Print the userimage URL for each e-mail address |
|
39
|
|
|
|
|
|
|
foreach my $email (keys %$addresses) { |
|
40
|
|
|
|
|
|
|
print $addresses->{$email}->{'userimage_url'} . "\n"; |
|
41
|
|
|
|
|
|
|
} |
|
42
|
|
|
|
|
|
|
} |
|
43
|
|
|
|
|
|
|
else { |
|
44
|
|
|
|
|
|
|
# We have a problem |
|
45
|
|
|
|
|
|
|
print STDERR "Error: " . $grav->errstr . "\n"; |
|
46
|
|
|
|
|
|
|
} |
|
47
|
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
# Read image file data |
|
49
|
|
|
|
|
|
|
my $data; |
|
50
|
|
|
|
|
|
|
{ |
|
51
|
|
|
|
|
|
|
local $/ = undef; |
|
52
|
|
|
|
|
|
|
open(F, "< my_pretty_face.png"); |
|
53
|
|
|
|
|
|
|
$data = ; |
|
54
|
|
|
|
|
|
|
close(F); |
|
55
|
|
|
|
|
|
|
} |
|
56
|
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
# Save the image as a new userimage |
|
58
|
|
|
|
|
|
|
$grav->save_data(data => encode_base64($data), rating => 0); |
|
59
|
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
... |
|
61
|
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
=head1 DESCRIPTION |
|
63
|
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
WebService::Gravatar is a Perl interface to Gravatar API. It aims at providing a |
|
65
|
|
|
|
|
|
|
close representation of the basic XML-RPC API, as documented on Gravatar |
|
66
|
|
|
|
|
|
|
website: L. All the method names, |
|
67
|
|
|
|
|
|
|
parameter names, and data structures are the same as in the API -- the only |
|
68
|
|
|
|
|
|
|
exception is that in the API the methods are named with camelCase, while the |
|
69
|
|
|
|
|
|
|
module uses lowercase_with_infix_underscores. |
|
70
|
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
=head1 METHODS |
|
72
|
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
All the instance methods return C on failure. More detailed error |
|
74
|
|
|
|
|
|
|
information can be obtained by calling L<"err"> and L<"errstr">. |
|
75
|
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
=head2 new |
|
77
|
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
Creates a new instance of WebService::Gravatar. |
|
79
|
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
my $grav = WebService::Gravatar->new(email => 'your@email.address', |
|
81
|
|
|
|
|
|
|
apikey => 'your_API_key'); |
|
82
|
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
Parameters: |
|
84
|
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
=over 4 |
|
86
|
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
=item * email |
|
88
|
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
B<(Required)> E-mail address. |
|
90
|
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
=item * apikey |
|
92
|
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
B<(Required)> API key. Can be ommitted if C is defined. |
|
94
|
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
=item * password |
|
96
|
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
B<(Required)> Account password. Can be ommitted if C is defined. |
|
98
|
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
=back |
|
100
|
|
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
=cut |
|
102
|
|
|
|
|
|
|
|
|
103
|
|
|
|
|
|
|
sub new { |
|
104
|
|
|
|
|
|
|
my $class = shift; |
|
105
|
|
|
|
|
|
|
my %args = @_; |
|
106
|
|
|
|
|
|
|
|
|
107
|
|
|
|
|
|
|
my $self = {}; |
|
108
|
|
|
|
|
|
|
bless($self, $class); |
|
109
|
|
|
|
|
|
|
|
|
110
|
|
|
|
|
|
|
if (!defined $args{'email'}) { |
|
111
|
|
|
|
|
|
|
carp "Required parameter 'email' is not defined"; |
|
112
|
|
|
|
|
|
|
} |
|
113
|
|
|
|
|
|
|
|
|
114
|
|
|
|
|
|
|
if (!defined $args{'apikey'} && !defined $args{'password'}) { |
|
115
|
|
|
|
|
|
|
carp "Either the 'apikey' or 'password' parameter must be defined"; |
|
116
|
|
|
|
|
|
|
} |
|
117
|
|
|
|
|
|
|
|
|
118
|
|
|
|
|
|
|
$self->{'err'} = undef; |
|
119
|
|
|
|
|
|
|
$self->{'errstr'} = undef; |
|
120
|
|
|
|
|
|
|
|
|
121
|
|
|
|
|
|
|
$self->{'apikey'} = $args{'apikey'}; |
|
122
|
|
|
|
|
|
|
$self->{'password'} = $args{'password'}; |
|
123
|
|
|
|
|
|
|
|
|
124
|
|
|
|
|
|
|
(my $email = $args{'email'}) =~ s/^\s+|\s+$//g; |
|
125
|
|
|
|
|
|
|
|
|
126
|
|
|
|
|
|
|
$self->{'cli'} = RPC::XML::Client->new( |
|
127
|
|
|
|
|
|
|
'https://secure.gravatar.com/xmlrpc?user=' . md5_hex(lc $email)); |
|
128
|
|
|
|
|
|
|
|
|
129
|
|
|
|
|
|
|
return $self; |
|
130
|
|
|
|
|
|
|
} |
|
131
|
|
|
|
|
|
|
|
|
132
|
|
|
|
|
|
|
sub _call { |
|
133
|
|
|
|
|
|
|
my $self = shift; |
|
134
|
|
|
|
|
|
|
my $method = shift; |
|
135
|
|
|
|
|
|
|
my %args = ( |
|
136
|
|
|
|
|
|
|
'apikey' => $self->{'apikey'}, |
|
137
|
|
|
|
|
|
|
'password' => $self->{'password'}, |
|
138
|
|
|
|
|
|
|
@_ |
|
139
|
|
|
|
|
|
|
); |
|
140
|
|
|
|
|
|
|
|
|
141
|
|
|
|
|
|
|
$self->{'err'} = undef; |
|
142
|
|
|
|
|
|
|
$self->{'errstr'} = undef; |
|
143
|
|
|
|
|
|
|
|
|
144
|
|
|
|
|
|
|
my $ret = $self->{'cli'}->send_request('grav.' . $method, \%args); |
|
145
|
|
|
|
|
|
|
|
|
146
|
|
|
|
|
|
|
if ($ret->is_fault) { |
|
147
|
|
|
|
|
|
|
$self->{'err'} = $ret->{'faultCode'}->value; |
|
148
|
|
|
|
|
|
|
$self->{'errstr'} = $ret->{'faultString'}->value; |
|
149
|
|
|
|
|
|
|
return undef; |
|
150
|
|
|
|
|
|
|
} |
|
151
|
|
|
|
|
|
|
else { |
|
152
|
|
|
|
|
|
|
return $ret->value; |
|
153
|
|
|
|
|
|
|
} |
|
154
|
|
|
|
|
|
|
} |
|
155
|
|
|
|
|
|
|
|
|
156
|
|
|
|
|
|
|
=head2 exists |
|
157
|
|
|
|
|
|
|
|
|
158
|
|
|
|
|
|
|
Checks whether a hash has a gravatar. |
|
159
|
|
|
|
|
|
|
|
|
160
|
|
|
|
|
|
|
$result = $grav->exists(hashes => ['e52beb5a6966554a02a56072cafebabe', |
|
161
|
|
|
|
|
|
|
'62345cdd79773f62a87fcbc6abadbabe']) |
|
162
|
|
|
|
|
|
|
|
|
163
|
|
|
|
|
|
|
Parameters: |
|
164
|
|
|
|
|
|
|
|
|
165
|
|
|
|
|
|
|
=over 4 |
|
166
|
|
|
|
|
|
|
|
|
167
|
|
|
|
|
|
|
=item * hashes |
|
168
|
|
|
|
|
|
|
|
|
169
|
|
|
|
|
|
|
B<(Required)> An array of email hashes to check. |
|
170
|
|
|
|
|
|
|
|
|
171
|
|
|
|
|
|
|
=back |
|
172
|
|
|
|
|
|
|
|
|
173
|
|
|
|
|
|
|
Returns: A reference to a hash that maps email hashes to statuses. Example: |
|
174
|
|
|
|
|
|
|
|
|
175
|
|
|
|
|
|
|
$result = { |
|
176
|
|
|
|
|
|
|
'e52beb5a6966554a02a56072cafebabe' => '1', |
|
177
|
|
|
|
|
|
|
'62345cdd79773f62a87fcbc6abadbabe' => '0' |
|
178
|
|
|
|
|
|
|
}; |
|
179
|
|
|
|
|
|
|
|
|
180
|
|
|
|
|
|
|
=cut |
|
181
|
|
|
|
|
|
|
|
|
182
|
|
|
|
|
|
|
sub exists { |
|
183
|
|
|
|
|
|
|
my $self = shift; |
|
184
|
|
|
|
|
|
|
my %args = @_; |
|
185
|
|
|
|
|
|
|
|
|
186
|
|
|
|
|
|
|
if (!defined $args{'hashes'}) { |
|
187
|
|
|
|
|
|
|
carp "Required parameter 'hashes' is not defined"; |
|
188
|
|
|
|
|
|
|
} |
|
189
|
|
|
|
|
|
|
|
|
190
|
|
|
|
|
|
|
return $self->_call('exists', %args); |
|
191
|
|
|
|
|
|
|
} |
|
192
|
|
|
|
|
|
|
|
|
193
|
|
|
|
|
|
|
=head2 addresses |
|
194
|
|
|
|
|
|
|
|
|
195
|
|
|
|
|
|
|
Gets a list of addresses for this account. |
|
196
|
|
|
|
|
|
|
|
|
197
|
|
|
|
|
|
|
$addresses = $grav->addresses; |
|
198
|
|
|
|
|
|
|
|
|
199
|
|
|
|
|
|
|
Returns: A reference to a hash that maps addresses to userimage data. Example: |
|
200
|
|
|
|
|
|
|
|
|
201
|
|
|
|
|
|
|
$addresses = { |
|
202
|
|
|
|
|
|
|
'some@email.address' => { |
|
203
|
|
|
|
|
|
|
'rating' => '0', |
|
204
|
|
|
|
|
|
|
'userimage' => '8bfc8da2562a53ddd7e630a68badf00d', |
|
205
|
|
|
|
|
|
|
'userimage_url' => 'http://en.gravatar.com/userimage/123456/8bfc8da2562a53ddd7e630a68badf00d.jpg' |
|
206
|
|
|
|
|
|
|
}, |
|
207
|
|
|
|
|
|
|
'another@email.address' => { |
|
208
|
|
|
|
|
|
|
'rating' => '1', |
|
209
|
|
|
|
|
|
|
'userimage' => '90f269fe7b67d0ce49f96427deadbabe', |
|
210
|
|
|
|
|
|
|
'userimage_url' => 'http://en.gravatar.com/userimage/123456/90f269fe7b67d0ce49f96427deadbabe.jpg' |
|
211
|
|
|
|
|
|
|
} |
|
212
|
|
|
|
|
|
|
}; |
|
213
|
|
|
|
|
|
|
|
|
214
|
|
|
|
|
|
|
=cut |
|
215
|
|
|
|
|
|
|
|
|
216
|
|
|
|
|
|
|
sub addresses { |
|
217
|
|
|
|
|
|
|
my $self = shift; |
|
218
|
|
|
|
|
|
|
|
|
219
|
|
|
|
|
|
|
return $self->_call('addresses'); |
|
220
|
|
|
|
|
|
|
} |
|
221
|
|
|
|
|
|
|
|
|
222
|
|
|
|
|
|
|
=head2 userimages |
|
223
|
|
|
|
|
|
|
|
|
224
|
|
|
|
|
|
|
Gets a list of userimages for this account. |
|
225
|
|
|
|
|
|
|
|
|
226
|
|
|
|
|
|
|
$userimages = $grav->userimages; |
|
227
|
|
|
|
|
|
|
|
|
228
|
|
|
|
|
|
|
Returns: A reference to a hash that maps userimages to data. Example: |
|
229
|
|
|
|
|
|
|
|
|
230
|
|
|
|
|
|
|
$userimages = { |
|
231
|
|
|
|
|
|
|
'8bfc8da2562a53ddd7e630a68badf00d' => [ |
|
232
|
|
|
|
|
|
|
'0', |
|
233
|
|
|
|
|
|
|
'http://en.gravatar.com/userimage/123456/8bfc8da2562a53ddd7e630a68badf00d.jpg' |
|
234
|
|
|
|
|
|
|
], |
|
235
|
|
|
|
|
|
|
'90f269fe7b67d0ce49f96427deadbabe' => [ |
|
236
|
|
|
|
|
|
|
'1', |
|
237
|
|
|
|
|
|
|
'http://en.gravatar.com/userimage/123456/90f269fe7b67d0ce49f96427deadbabe.jpg' |
|
238
|
|
|
|
|
|
|
] |
|
239
|
|
|
|
|
|
|
}; |
|
240
|
|
|
|
|
|
|
|
|
241
|
|
|
|
|
|
|
=cut |
|
242
|
|
|
|
|
|
|
|
|
243
|
|
|
|
|
|
|
sub userimages { |
|
244
|
|
|
|
|
|
|
my $self = shift; |
|
245
|
|
|
|
|
|
|
|
|
246
|
|
|
|
|
|
|
return $self->_call('userimages'); |
|
247
|
|
|
|
|
|
|
} |
|
248
|
|
|
|
|
|
|
|
|
249
|
|
|
|
|
|
|
=head2 save_data |
|
250
|
|
|
|
|
|
|
|
|
251
|
|
|
|
|
|
|
Saves binary image data as a userimage for this account. |
|
252
|
|
|
|
|
|
|
|
|
253
|
|
|
|
|
|
|
$grav->save_data(data => $data, rating => 1); |
|
254
|
|
|
|
|
|
|
|
|
255
|
|
|
|
|
|
|
Parameters: |
|
256
|
|
|
|
|
|
|
|
|
257
|
|
|
|
|
|
|
=over 4 |
|
258
|
|
|
|
|
|
|
|
|
259
|
|
|
|
|
|
|
=item * data |
|
260
|
|
|
|
|
|
|
|
|
261
|
|
|
|
|
|
|
B<(Required)> A base64 encoded image. |
|
262
|
|
|
|
|
|
|
|
|
263
|
|
|
|
|
|
|
=item * rating |
|
264
|
|
|
|
|
|
|
|
|
265
|
|
|
|
|
|
|
B<(Required)> Rating. |
|
266
|
|
|
|
|
|
|
|
|
267
|
|
|
|
|
|
|
=back |
|
268
|
|
|
|
|
|
|
|
|
269
|
|
|
|
|
|
|
Returns: Userimage string. |
|
270
|
|
|
|
|
|
|
|
|
271
|
|
|
|
|
|
|
=cut |
|
272
|
|
|
|
|
|
|
|
|
273
|
|
|
|
|
|
|
sub save_data { |
|
274
|
|
|
|
|
|
|
my $self = shift; |
|
275
|
|
|
|
|
|
|
my %args = @_; |
|
276
|
|
|
|
|
|
|
|
|
277
|
|
|
|
|
|
|
if (!defined $args{'data'}) { |
|
278
|
|
|
|
|
|
|
carp "Required parameter 'data' is not defined"; |
|
279
|
|
|
|
|
|
|
} |
|
280
|
|
|
|
|
|
|
|
|
281
|
|
|
|
|
|
|
if (!defined $args{'rating'}) { |
|
282
|
|
|
|
|
|
|
carp "Required parameter 'rating' is not defined"; |
|
283
|
|
|
|
|
|
|
} |
|
284
|
|
|
|
|
|
|
|
|
285
|
|
|
|
|
|
|
return $self->_call('saveData', %args); |
|
286
|
|
|
|
|
|
|
} |
|
287
|
|
|
|
|
|
|
|
|
288
|
|
|
|
|
|
|
=head2 save_url |
|
289
|
|
|
|
|
|
|
|
|
290
|
|
|
|
|
|
|
Reads an image via its URL and saves that as a userimage for this account. |
|
291
|
|
|
|
|
|
|
|
|
292
|
|
|
|
|
|
|
$grav->save_url(url => 'http://some.domain.com/image.png', rating => 0); |
|
293
|
|
|
|
|
|
|
|
|
294
|
|
|
|
|
|
|
Parameters: |
|
295
|
|
|
|
|
|
|
|
|
296
|
|
|
|
|
|
|
=over 4 |
|
297
|
|
|
|
|
|
|
|
|
298
|
|
|
|
|
|
|
=item * url |
|
299
|
|
|
|
|
|
|
|
|
300
|
|
|
|
|
|
|
B<(Required)> A full URL to an image. |
|
301
|
|
|
|
|
|
|
|
|
302
|
|
|
|
|
|
|
=item * rating |
|
303
|
|
|
|
|
|
|
|
|
304
|
|
|
|
|
|
|
B<(Required)> Rating. |
|
305
|
|
|
|
|
|
|
|
|
306
|
|
|
|
|
|
|
=back |
|
307
|
|
|
|
|
|
|
|
|
308
|
|
|
|
|
|
|
Returns: Userimage string. |
|
309
|
|
|
|
|
|
|
|
|
310
|
|
|
|
|
|
|
=cut |
|
311
|
|
|
|
|
|
|
|
|
312
|
|
|
|
|
|
|
sub save_url { |
|
313
|
|
|
|
|
|
|
my $self = shift; |
|
314
|
|
|
|
|
|
|
my %args = @_; |
|
315
|
|
|
|
|
|
|
|
|
316
|
|
|
|
|
|
|
if (!defined $args{'url'}) { |
|
317
|
|
|
|
|
|
|
carp "Required parameter 'url' is not defined"; |
|
318
|
|
|
|
|
|
|
} |
|
319
|
|
|
|
|
|
|
|
|
320
|
|
|
|
|
|
|
if (!defined $args{'rating'}) { |
|
321
|
|
|
|
|
|
|
carp "Required parameter 'rating' is not defined"; |
|
322
|
|
|
|
|
|
|
} |
|
323
|
|
|
|
|
|
|
|
|
324
|
|
|
|
|
|
|
return $self->_call('saveUrl', %args); |
|
325
|
|
|
|
|
|
|
} |
|
326
|
|
|
|
|
|
|
|
|
327
|
|
|
|
|
|
|
=head2 use_userimage |
|
328
|
|
|
|
|
|
|
|
|
329
|
|
|
|
|
|
|
Uses the specified userimage as a gravatar for one or more addresses on this |
|
330
|
|
|
|
|
|
|
account. |
|
331
|
|
|
|
|
|
|
|
|
332
|
|
|
|
|
|
|
$grav->use_userimage(userimage => '9116aa83a568563290a681df61c0ffee'. |
|
333
|
|
|
|
|
|
|
addresses => ['some@email.address', 'another@email.address']); |
|
334
|
|
|
|
|
|
|
|
|
335
|
|
|
|
|
|
|
Parameters: |
|
336
|
|
|
|
|
|
|
|
|
337
|
|
|
|
|
|
|
=over 4 |
|
338
|
|
|
|
|
|
|
|
|
339
|
|
|
|
|
|
|
=item * userimage |
|
340
|
|
|
|
|
|
|
|
|
341
|
|
|
|
|
|
|
B<(Required)> The userimage to be used. |
|
342
|
|
|
|
|
|
|
|
|
343
|
|
|
|
|
|
|
=item * addresses |
|
344
|
|
|
|
|
|
|
|
|
345
|
|
|
|
|
|
|
B<(Required)> An array of email addresses for which this userimage will be used. |
|
346
|
|
|
|
|
|
|
|
|
347
|
|
|
|
|
|
|
=back |
|
348
|
|
|
|
|
|
|
|
|
349
|
|
|
|
|
|
|
Returns: 1 on success, undef on failure. |
|
350
|
|
|
|
|
|
|
|
|
351
|
|
|
|
|
|
|
=cut |
|
352
|
|
|
|
|
|
|
|
|
353
|
|
|
|
|
|
|
sub use_userimage { |
|
354
|
|
|
|
|
|
|
my $self = shift; |
|
355
|
|
|
|
|
|
|
my %args = @_; |
|
356
|
|
|
|
|
|
|
|
|
357
|
|
|
|
|
|
|
if (!defined $args{'userimage'}) { |
|
358
|
|
|
|
|
|
|
carp "Required parameter 'userimage' is not defined"; |
|
359
|
|
|
|
|
|
|
} |
|
360
|
|
|
|
|
|
|
|
|
361
|
|
|
|
|
|
|
if (!defined $args{'addresses'}) { |
|
362
|
|
|
|
|
|
|
carp "Required parameter 'addresses' is not defined"; |
|
363
|
|
|
|
|
|
|
} |
|
364
|
|
|
|
|
|
|
|
|
365
|
|
|
|
|
|
|
return $self->_call('useUserimage', %args); |
|
366
|
|
|
|
|
|
|
} |
|
367
|
|
|
|
|
|
|
|
|
368
|
|
|
|
|
|
|
=head2 remove_image |
|
369
|
|
|
|
|
|
|
|
|
370
|
|
|
|
|
|
|
Removes the userimage associated with one or more email addresses. |
|
371
|
|
|
|
|
|
|
|
|
372
|
|
|
|
|
|
|
$result = $grav->remove_image(addresses => ['some@email.address', |
|
373
|
|
|
|
|
|
|
'another@email.address']) |
|
374
|
|
|
|
|
|
|
|
|
375
|
|
|
|
|
|
|
Parameters: |
|
376
|
|
|
|
|
|
|
|
|
377
|
|
|
|
|
|
|
=over 4 |
|
378
|
|
|
|
|
|
|
|
|
379
|
|
|
|
|
|
|
=item * addresses |
|
380
|
|
|
|
|
|
|
|
|
381
|
|
|
|
|
|
|
B<(Required)> An array of email addresses to remove userimages for. |
|
382
|
|
|
|
|
|
|
|
|
383
|
|
|
|
|
|
|
=back |
|
384
|
|
|
|
|
|
|
|
|
385
|
|
|
|
|
|
|
Returns: A reference to a hash that maps email addresses to statuses. Example: |
|
386
|
|
|
|
|
|
|
|
|
387
|
|
|
|
|
|
|
result = { |
|
388
|
|
|
|
|
|
|
'some@email.address' => 1, |
|
389
|
|
|
|
|
|
|
'another@email.address' => 0 |
|
390
|
|
|
|
|
|
|
}; |
|
391
|
|
|
|
|
|
|
|
|
392
|
|
|
|
|
|
|
=cut |
|
393
|
|
|
|
|
|
|
|
|
394
|
|
|
|
|
|
|
sub remove_image { |
|
395
|
|
|
|
|
|
|
my $self = shift; |
|
396
|
|
|
|
|
|
|
my %args = @_; |
|
397
|
|
|
|
|
|
|
|
|
398
|
|
|
|
|
|
|
if (!defined $args{'addresses'}) { |
|
399
|
|
|
|
|
|
|
carp "Required parameter 'addresses' is not defined"; |
|
400
|
|
|
|
|
|
|
} |
|
401
|
|
|
|
|
|
|
|
|
402
|
|
|
|
|
|
|
return $self->_call('removeImage', %args); |
|
403
|
|
|
|
|
|
|
} |
|
404
|
|
|
|
|
|
|
|
|
405
|
|
|
|
|
|
|
=head2 delete_userimage |
|
406
|
|
|
|
|
|
|
|
|
407
|
|
|
|
|
|
|
Removes a userimage from the account and any email addresses with which it is |
|
408
|
|
|
|
|
|
|
associated. |
|
409
|
|
|
|
|
|
|
|
|
410
|
|
|
|
|
|
|
$grav->delete_userimage(userimage => '292ed56ce849657d47b04105deadbeef'); |
|
411
|
|
|
|
|
|
|
|
|
412
|
|
|
|
|
|
|
Parameters: |
|
413
|
|
|
|
|
|
|
|
|
414
|
|
|
|
|
|
|
=over 4 |
|
415
|
|
|
|
|
|
|
|
|
416
|
|
|
|
|
|
|
=item * userimage |
|
417
|
|
|
|
|
|
|
|
|
418
|
|
|
|
|
|
|
B<(Required)> The userimage to be removed from the account. |
|
419
|
|
|
|
|
|
|
|
|
420
|
|
|
|
|
|
|
=back |
|
421
|
|
|
|
|
|
|
|
|
422
|
|
|
|
|
|
|
Returns: 1 on success, undef on failure. |
|
423
|
|
|
|
|
|
|
|
|
424
|
|
|
|
|
|
|
=cut |
|
425
|
|
|
|
|
|
|
|
|
426
|
|
|
|
|
|
|
sub delete_userimage { |
|
427
|
|
|
|
|
|
|
my $self = shift; |
|
428
|
|
|
|
|
|
|
my %args = @_; |
|
429
|
|
|
|
|
|
|
|
|
430
|
|
|
|
|
|
|
if (!defined $args{'userimage'}) { |
|
431
|
|
|
|
|
|
|
carp "Required parameter 'userimage' is not defined"; |
|
432
|
|
|
|
|
|
|
} |
|
433
|
|
|
|
|
|
|
|
|
434
|
|
|
|
|
|
|
return $self->_call('deleteUserimage', %args); |
|
435
|
|
|
|
|
|
|
} |
|
436
|
|
|
|
|
|
|
|
|
437
|
|
|
|
|
|
|
=head2 test |
|
438
|
|
|
|
|
|
|
|
|
439
|
|
|
|
|
|
|
API test method. |
|
440
|
|
|
|
|
|
|
|
|
441
|
|
|
|
|
|
|
$result = $grav->test(param => 1); |
|
442
|
|
|
|
|
|
|
|
|
443
|
|
|
|
|
|
|
Returns: A reference to a hash which represents the parameters passed to the |
|
444
|
|
|
|
|
|
|
test method. |
|
445
|
|
|
|
|
|
|
|
|
446
|
|
|
|
|
|
|
=head2 err |
|
447
|
|
|
|
|
|
|
|
|
448
|
|
|
|
|
|
|
Returns the numeric code of last error. |
|
449
|
|
|
|
|
|
|
|
|
450
|
|
|
|
|
|
|
$err_code = $grav->err; |
|
451
|
|
|
|
|
|
|
|
|
452
|
|
|
|
|
|
|
=cut |
|
453
|
|
|
|
|
|
|
|
|
454
|
|
|
|
|
|
|
sub err { |
|
455
|
|
|
|
|
|
|
my $self = shift; |
|
456
|
|
|
|
|
|
|
|
|
457
|
|
|
|
|
|
|
return $self->{'err'}; |
|
458
|
|
|
|
|
|
|
} |
|
459
|
|
|
|
|
|
|
|
|
460
|
|
|
|
|
|
|
=head2 errstr |
|
461
|
|
|
|
|
|
|
|
|
462
|
|
|
|
|
|
|
Returns the human readable text for last error. |
|
463
|
|
|
|
|
|
|
|
|
464
|
|
|
|
|
|
|
$err_description = $grav->errstr; |
|
465
|
|
|
|
|
|
|
|
|
466
|
|
|
|
|
|
|
=cut |
|
467
|
|
|
|
|
|
|
|
|
468
|
|
|
|
|
|
|
sub errstr { |
|
469
|
|
|
|
|
|
|
my $self = shift; |
|
470
|
|
|
|
|
|
|
|
|
471
|
|
|
|
|
|
|
return $self->{'errstr'}; |
|
472
|
|
|
|
|
|
|
} |
|
473
|
|
|
|
|
|
|
|
|
474
|
|
|
|
|
|
|
=head1 AUTHOR |
|
475
|
|
|
|
|
|
|
|
|
476
|
|
|
|
|
|
|
Michal Wojciechowski, C<< >> |
|
477
|
|
|
|
|
|
|
|
|
478
|
|
|
|
|
|
|
=head1 BUGS |
|
479
|
|
|
|
|
|
|
|
|
480
|
|
|
|
|
|
|
Please report any bugs or feature requests to C, or through |
|
481
|
|
|
|
|
|
|
the web interface at L. I will be notified, and then you'll |
|
482
|
|
|
|
|
|
|
automatically be notified of progress on your bug as I make changes. |
|
483
|
|
|
|
|
|
|
|
|
484
|
|
|
|
|
|
|
|
|
485
|
|
|
|
|
|
|
=head1 SUPPORT |
|
486
|
|
|
|
|
|
|
|
|
487
|
|
|
|
|
|
|
You can find documentation for this module with the perldoc command. |
|
488
|
|
|
|
|
|
|
|
|
489
|
|
|
|
|
|
|
perldoc WebService::Gravatar |
|
490
|
|
|
|
|
|
|
|
|
491
|
|
|
|
|
|
|
|
|
492
|
|
|
|
|
|
|
You can also look for information at: |
|
493
|
|
|
|
|
|
|
|
|
494
|
|
|
|
|
|
|
=over 4 |
|
495
|
|
|
|
|
|
|
|
|
496
|
|
|
|
|
|
|
=item * RT: CPAN's request tracker |
|
497
|
|
|
|
|
|
|
|
|
498
|
|
|
|
|
|
|
L |
|
499
|
|
|
|
|
|
|
|
|
500
|
|
|
|
|
|
|
=item * AnnoCPAN: Annotated CPAN documentation |
|
501
|
|
|
|
|
|
|
|
|
502
|
|
|
|
|
|
|
L |
|
503
|
|
|
|
|
|
|
|
|
504
|
|
|
|
|
|
|
=item * CPAN Ratings |
|
505
|
|
|
|
|
|
|
|
|
506
|
|
|
|
|
|
|
L |
|
507
|
|
|
|
|
|
|
|
|
508
|
|
|
|
|
|
|
=item * Search CPAN |
|
509
|
|
|
|
|
|
|
|
|
510
|
|
|
|
|
|
|
L |
|
511
|
|
|
|
|
|
|
|
|
512
|
|
|
|
|
|
|
=back |
|
513
|
|
|
|
|
|
|
|
|
514
|
|
|
|
|
|
|
|
|
515
|
|
|
|
|
|
|
=head1 COPYRIGHT & LICENSE |
|
516
|
|
|
|
|
|
|
|
|
517
|
|
|
|
|
|
|
Copyright 2010 Michal Wojciechowski, all rights reserved. |
|
518
|
|
|
|
|
|
|
|
|
519
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify it |
|
520
|
|
|
|
|
|
|
under the same terms as Perl itself. |
|
521
|
|
|
|
|
|
|
|
|
522
|
|
|
|
|
|
|
|
|
523
|
|
|
|
|
|
|
=head1 SEE ALSO |
|
524
|
|
|
|
|
|
|
|
|
525
|
|
|
|
|
|
|
=over 4 |
|
526
|
|
|
|
|
|
|
|
|
527
|
|
|
|
|
|
|
=item * Gravatar XML-RPC API Documentation |
|
528
|
|
|
|
|
|
|
|
|
529
|
|
|
|
|
|
|
L |
|
530
|
|
|
|
|
|
|
|
|
531
|
|
|
|
|
|
|
=back |
|
532
|
|
|
|
|
|
|
|
|
533
|
|
|
|
|
|
|
=cut |
|
534
|
|
|
|
|
|
|
|
|
535
|
|
|
|
|
|
|
1; # End of WebService::Gravatar |