line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package WebService::Tagzania::Response ; |
2
|
|
|
|
|
|
|
|
3
|
2
|
|
|
2
|
|
12
|
use warnings ; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
75
|
|
4
|
2
|
|
|
2
|
|
11
|
use strict ; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
64
|
|
5
|
|
|
|
|
|
|
|
6
|
2
|
|
|
2
|
|
1807
|
use HTTP::Response ; |
|
2
|
|
|
|
|
14191
|
|
|
2
|
|
|
|
|
1924
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
our @ISA = qw( HTTP::Response ) ; |
9
|
|
|
|
|
|
|
our $VERSION = 0.01 ; |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
sub new { |
12
|
0
|
|
|
0
|
1
|
|
my $class = shift ; |
13
|
0
|
|
|
|
|
|
my $self = new HTTP::Response ; |
14
|
0
|
|
|
|
|
|
my $rh_oprions = shift ; |
15
|
|
|
|
|
|
|
|
16
|
0
|
|
|
|
|
|
bless $self, $class ; |
17
|
0
|
|
|
|
|
|
return $self ; |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
} |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
sub init_obj { |
22
|
0
|
|
|
0
|
0
|
|
my $self = shift ; |
23
|
0
|
|
|
|
|
|
$self->{results} = undef ; |
24
|
0
|
|
|
|
|
|
$self->{is_success} = 0 ; |
25
|
0
|
|
|
|
|
|
$self->{error_code} = undef ; |
26
|
0
|
|
|
|
|
|
$self->{error_message} = undef ; |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
sub set_success { |
31
|
0
|
|
|
0
|
0
|
|
my ($self, $data) = (@_) ; |
32
|
0
|
|
|
|
|
|
$self->{is_success} = 1 ; |
33
|
0
|
|
|
|
|
|
$self->{results} = $data ; |
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
sub set_fail { |
37
|
0
|
|
|
0
|
0
|
|
my ($self, $errcode, $errmsg) = (@_) ; |
38
|
0
|
|
|
|
|
|
$self->{is_success} = 0 ; |
39
|
0
|
|
|
|
|
|
$self->{error_code} = $errcode ; |
40
|
0
|
|
|
|
|
|
$self->{error_message} = $errmsg ; |
41
|
|
|
|
|
|
|
} |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
=head1 NAME |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
WebService::Tagzania::API - Tagzania API Interface |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
=head1 SYNOPSIS |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
use WebService::Tagzania::API; |
50
|
|
|
|
|
|
|
my $tagobj = new WebService::Tagzania::API() ; |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
my $rh_params = { |
53
|
|
|
|
|
|
|
start => 0, |
54
|
|
|
|
|
|
|
number => 200, |
55
|
|
|
|
|
|
|
minlng => -9.25, |
56
|
|
|
|
|
|
|
minlat => 35.35, |
57
|
|
|
|
|
|
|
maxlng => 4.55, |
58
|
|
|
|
|
|
|
maxlat => 43.80, |
59
|
|
|
|
|
|
|
} ; |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
my $results = $api->query( $rh_params ) ; |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
next unless |
64
|
|
|
|
|
|
|
$results->{_msg} eq 'OK' ; |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
my $content = $results->{_content} ; |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
# do something with the XML inside $content |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
=head1 DESCRIPTION |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
Base class for the Tagzania API Response object. |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
=head1 BUGS |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
None. |
77
|
|
|
|
|
|
|
That I know of ;) |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
=head1 AUTHOR |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
Spiros Denaxas |
82
|
|
|
|
|
|
|
CPAN ID: SDEN |
83
|
|
|
|
|
|
|
Lokku Ltd |
84
|
|
|
|
|
|
|
s [dot] denaxas [@] gmail [dot]com |
85
|
|
|
|
|
|
|
http://idaru.blogspot.com |
86
|
|
|
|
|
|
|
http://www.nestoria.co.uk |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
=head1 COPYRIGHT |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
This program is free software; you can redistribute |
91
|
|
|
|
|
|
|
it and/or modify it under the same terms as Perl itself. |
92
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
The full text of the license can be found in the |
94
|
|
|
|
|
|
|
LICENSE file included with this module. |
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
=head1 SEE ALSO |
98
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
L, L, L |
100
|
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
=cut |
102
|
|
|
|
|
|
|
|
103
|
|
|
|
|
|
|
1 ; |