summaryrefslogtreecommitdiff
path: root/WebSmart.pm
diff options
context:
space:
mode:
authorMark Wells <mark@freeside.biz>2013-11-30 16:27:02 -0800
committerMark Wells <mark@freeside.biz>2013-11-30 16:27:02 -0800
commitbd7d57b6aa7a1af31dc38384683a225c8e1ec02f (patch)
tree5dbb7a8d6fc311aa3f0fad47bfd8fd8f035f7835 /WebSmart.pm
parent68c383d52b1f7316d820007e19e00ba7f62ba82f (diff)
initial commit that actually works
Diffstat (limited to 'WebSmart.pm')
-rw-r--r--WebSmart.pm9
1 files changed, 5 insertions, 4 deletions
diff --git a/WebSmart.pm b/WebSmart.pm
index c54ee19..ddc89cf 100644
--- a/WebSmart.pm
+++ b/WebSmart.pm
@@ -92,7 +92,7 @@ sub query {
$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});
@@ -100,7 +100,7 @@ sub query {
} 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},
@@ -199,11 +199,12 @@ error or warning messages.
sub status_message {
my $self = shift;
- join("\n",
- $self->message,
+ my $status = join("\n",
map { $self->result_string($_) }
split(',', $self->code)
);
+ $status = join("\n", $self->message, $status) if $self->message and $status;
+ $status;
}
=head2 result_string CODE