Skip Menu |

This queue is for tickets about the Geo-Coder-PlaceFinder CPAN distribution.

Report information
The Basics
Id: 84444
Status: resolved
Priority: 0/
Queue: Geo-Coder-PlaceFinder

People
Owner: Nobody in particular
Requestors: HJANSEN [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Critical
Broken in: 0.05
Fixed in: (no value)



Subject: PlaceFinder API has been removed/replaced
Yahoo apparently removed or replaced the PlaceFinder API on which this module relied. Seems like there are two options: switch to the commercial BOSS placefinder API or use the (rate limited) datatables and YQL. Maybe split into two modules? The following hack-ish patch may provide a starting point for updating the module: --- PlaceFinder.pm.orig 2013-04-05 12:10:01.000000000 +0200 +++ PlaceFinder.pm 2013-04-05 12:24:17.000000000 +0200 @@ -53,14 +53,17 @@ my ($self, @params) = @_; my %params = (@params % 2) ? (location => @params) : @params; my $raw = delete $params{raw}; + my $location = delete $params{location}; $_ = Encode::encode('utf-8', $_) for values %params; - - my $uri = URI->new('http://where.yahooapis.com/geocode'); + #http://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20geo.placefinder%20where%20text%3D%22701%2BFirst%2BAve%2C%2BSunnyvale%2C%2BCA%22&diagnostics=false&flags=JRSTX&gflags=AC&format=json + my $uri = URI->new('http://query.yahooapis.com/v1/public/yql'); $uri->query_form( - appid => $self->{appid}, - flags => 'JRSTX', - gflags => 'AC', + diagnostics => 'false', + flags => 'JRSTX', + gflags => 'AC', + format => 'json', + q => 'select * from geo.placefinder where text="' . $location . '"', %params, ); @@ -75,8 +78,9 @@ return unless $data; return $data if $raw; - my @results = @{ $data->{ResultSet}{Results} || [] }; - return wantarray ? @results : $results[0]; + #my @results = @{ $data->{ResultSet}{Results} || [] }; + #return wantarray ? @results : $results[0]; + return $data->{query}{results}{Result}; } Note that I didn´t check for array context. I´m not really sure how the JSON would look in cases of multiple results.
On Fri Apr 05 06:37:28 2013, HJANSEN wrote: Show quoted text
> Yahoo apparently removed or replaced the PlaceFinder API on which this > module relied. > Seems like there are two options: switch to the commercial BOSS > placefinder API or use the (rate limited) datatables and YQL. > Maybe split into two modules?
thanks for the heads up. i'm going to delete the dist from cpan, but you can upload a modified copy as Geo-Coder-YQL.