line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Net::Zemanta::Preferences; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
=head1 NAME |
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
Net::Zemanta::Preferences - Perl interface to Zemanta user preferences |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
=cut |
8
|
|
|
|
|
|
|
|
9
|
1
|
|
|
1
|
|
1253
|
use warnings; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
36
|
|
10
|
1
|
|
|
1
|
|
5
|
use strict; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
32
|
|
11
|
|
|
|
|
|
|
|
12
|
1
|
|
|
1
|
|
5
|
use Net::Zemanta::Method; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
145
|
|
13
|
|
|
|
|
|
|
our @ISA = qw(Net::Zemanta::Method); |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
=head1 SYNOPSIS |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
use Net::Zemanta::Preferences; |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
my $zemanta = Net::Zemanta::Preferences->new( |
20
|
|
|
|
|
|
|
APIKEY => 'your-API-key' |
21
|
|
|
|
|
|
|
); |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
my $preferences = $zemanta->get(); |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
# URL of the web page for setting preferences |
26
|
|
|
|
|
|
|
$preferences->{config_url} |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
# User's Amazon affiliate ID |
29
|
|
|
|
|
|
|
$preferences->{config_url} |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
=head1 METHODS |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
=over 8 |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
=item B |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
Net::Zemanta::Preferences->new(PARAM => ...); |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
Acceptable parameters: |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
=over 4 |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
=item APIKEY |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
The API key used for authentication with the service. |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
=item USER_AGENT |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
If supplied the value is prepended to this module's identification string |
50
|
|
|
|
|
|
|
to become something like: |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
your-killer-app/0.042 Perl-Net-Zemanta/0.1 libwww-perl/5.8 |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
Otherwise just Net::Zemanta's user agent string will be sent. |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
=back |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
C returns C on error. |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
=cut |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
sub new { |
63
|
2
|
|
|
2
|
1
|
534
|
my $class = shift; |
64
|
2
|
|
|
|
|
6
|
my %params = @_; |
65
|
|
|
|
|
|
|
|
66
|
2
|
|
|
|
|
4
|
$params{METHOD} = "zemanta.preferences"; |
67
|
|
|
|
|
|
|
|
68
|
2
|
|
|
|
|
13
|
my $self = $class->SUPER::new(%params); |
69
|
|
|
|
|
|
|
|
70
|
2
|
100
|
|
|
|
13
|
return unless $self; |
71
|
|
|
|
|
|
|
|
72
|
1
|
|
|
|
|
2
|
bless ($self, $class); |
73
|
1
|
|
|
|
|
4
|
return $self; |
74
|
|
|
|
|
|
|
} |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
=item B |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
Returns current settings for the specified API key in form of a hash reference. |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
See L for a list of all available settings. |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
Returns C on error. |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
=item B |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
If the last call to C returned an error, this function returns a |
87
|
|
|
|
|
|
|
string containing a short description of the error. Otherwise it returns |
88
|
|
|
|
|
|
|
C. |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
=back |
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
=cut |
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
sub get { |
95
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
96
|
|
|
|
|
|
|
|
97
|
0
|
|
|
|
|
|
return $self->execute(); |
98
|
|
|
|
|
|
|
} |
99
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
=head1 SEE ALSO |
101
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
=over 4 |
103
|
|
|
|
|
|
|
|
104
|
|
|
|
|
|
|
=item * L |
105
|
|
|
|
|
|
|
|
106
|
|
|
|
|
|
|
=item * L |
107
|
|
|
|
|
|
|
|
108
|
|
|
|
|
|
|
=back |
109
|
|
|
|
|
|
|
|
110
|
|
|
|
|
|
|
=head1 AUTHOR |
111
|
|
|
|
|
|
|
|
112
|
|
|
|
|
|
|
Tomaz Solc Etomaz@zemanta.comE |
113
|
|
|
|
|
|
|
|
114
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
115
|
|
|
|
|
|
|
|
116
|
|
|
|
|
|
|
Copyright (C) 2008 by Zemanta ltd. |
117
|
|
|
|
|
|
|
|
118
|
|
|
|
|
|
|
This library is free software; you can redistribute it and/or modify it under |
119
|
|
|
|
|
|
|
the same terms as Perl itself, either Perl version 5.8.7 or, at your option, |
120
|
|
|
|
|
|
|
any later version of Perl 5 you may have available. |
121
|
|
|
|
|
|
|
|
122
|
|
|
|
|
|
|
=cut |