projects
/
Geo-Melissa-WebSmart.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
68c383d
)
initial commit that actually works
author
Mark Wells
<mark@freeside.biz>
Sun, 1 Dec 2013 00:27:02 +0000
(16:27 -0800)
committer
Mark Wells
<mark@freeside.biz>
Sun, 1 Dec 2013 00:27:02 +0000
(16:27 -0800)
Makefile.PL
patch
|
blob
|
history
WebSmart.pm
patch
|
blob
|
history
diff --git
a/Makefile.PL
b/Makefile.PL
index
94fd136
..
22ec7f4
100644
(file)
--- a/
Makefile.PL
+++ b/
Makefile.PL
@@
-13,7
+13,9
@@
WriteMakefile(
: ()),
PL_FILES => {},
PREREQ_PM => {
: ()),
PL_FILES => {},
PREREQ_PM => {
- 'Test::More' => 0,
+ 'Test::More' => 0,
+ 'XML::LibXML' => 2,
+ 'LWP::UserAgent' => 0,
},
dist => { COMPRESS => 'gzip -9f', SUFFIX => 'gz', },
clean => { FILES => 'Geo-Melissa-WebSmart-*' },
},
dist => { COMPRESS => 'gzip -9f', SUFFIX => 'gz', },
clean => { FILES => 'Geo-Melissa-WebSmart-*' },
diff --git
a/WebSmart.pm
b/WebSmart.pm
index
c54ee19
..
ddc89cf
100644
(file)
--- a/
WebSmart.pm
+++ b/
WebSmart.pm
@@
-92,7
+92,7
@@
sub query {
$root = $root->firstChild; # ResponseArray
my $data = treeify($root);
if (exists $data->{Record}) {
$root = $root->firstChild; # ResponseArray
my $data = treeify($root);
if (exists $data->{Record}) {
- $self->address($data->{Address});
+ $self->address($data->{
Record}->{
Address});
$self->code($data->{Record}->{Results});
} else {
$self->code($data->{Results});
$self->code($data->{Record}->{Results});
} else {
$self->code($data->{Results});
@@
-100,7
+100,7
@@
sub query {
} else {
$self->message( $resp->status_line );
}
} else {
$self->message( $resp->status_line );
}
- if ( $geocode and $self->address
and $self->address->{AddressKey} > 0
) {
+ if ( $geocode and $self->address
->{AddressKey}
) {
$uri = URI->new($geocoder_uri);
$uri->query_form(
id => $opt{id},
$uri = URI->new($geocoder_uri);
$uri->query_form(
id => $opt{id},
@@
-199,11
+199,12
@@
error or warning messages.
sub status_message {
my $self = shift;
sub status_message {
my $self = shift;
- join("\n",
- $self->message,
+ my $status = join("\n",
map { $self->result_string($_) }
split(',', $self->code)
);
map { $self->result_string($_) }
split(',', $self->code)
);
+ $status = join("\n", $self->message, $status) if $self->message and $status;
+ $status;
}
=head2 result_string CODE
}
=head2 result_string CODE