Geocoder's integration with Yahoo Placefinder API appears broken as of Oct. 1, 2012. This post on the Yahoo Developer Network suggests, "Yahoo PlaceFinder API seems to have upgraded from version 1.0 to version 2.0 in the past few days."

http://developer.yahoo.com/forum/PlaceFinder-General-Discussion/PlaceFin...

Also see http://developer.yahoo.com/blogs/ydn/posts/2012/09/introducing-boss-geo-...

"We intend to shut down the current free versions of PlaceFinder and PlaceMaker on November 17, 2012."

We're currently using Geocoder in production with Yahoo as the geocoding mechanism. Is there a simple code change to make Geocoder compatible with the new API?

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

jtherkel’s picture

I was able to get my site running again by modifying the last lines of sites/all/modules/contrib/geocoder/plugins/geocoder_handler/yahoo.inc. Will work on turning this into a patch. In the meantime, here's the code.

function _geocoder_yahoo_geometry(&$data) {
  if (!isset($data->ResultSet->Result->longitude, $data->ResultSet)) {
    return NULL;
  }
  return new Point($data->ResultSet->Result->longitude, $data->ResultSet->Result->latitude);
}
jtherkel’s picture

Status: Active » Needs review
FileSize
964 bytes

Attached please find a patch that updates Geocoder to work with Yahoo Placefinder API v2. It also includes the ability to roll back to v1 in case Yahoo changes the API back.

poukram’s picture

It's work for me ! Thanks for this patch.

phayes’s picture

Status: Needs review » Fixed

Done!

phayes’s picture

Done!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

jpstrikesback’s picture

Title: Yahoo Placefinder API now returns random results » Yahoo Placefinder API set to sunset Nov 17.
Category: bug » feature
Priority: Normal » Major
Status: Closed (fixed) » Active

As of Nov 17 the free Yahoo Placefinder API will be shut down in favor of the new pay BOSS Placefinder API. Of note it now requires Oauth.

I'm updating this issue as it seems that people who would care are subscribed.

jtherkel’s picture

Our deadline of Nov. 17 approaches quickly. Is anyone else working on updating the Yahoo code for the paid Yahoo BOSS Geo service? Or is it relatively easy to switch to another free provider? What about MapQuest?

Assuming we need Yahoo, here's what I might do (have not started yet).

1) Upload credit card info to get my OAuth key.

2) Temporarily hack sites/all/modules/contrib/geocoder/plugins/geocoder_handler/yahoo.inc to test functionality.

3) Add some fields to the settings page so site administrators can manage Yahoo's OAuth keys. On my D7 install, this shows up under admin/structure/types/manage/name_of_my_content_type/fields/field_geolocation, where field_geolocation is the relevant field's machine name.

How are you handling this issue?

that0n3guy’s picture

I have a large database that I am using yahoo on as well. I could use google but it sucks when your testing and you hit your 2500 query limit.

I did some quick searching and found a decent list: http://blog.programmableweb.com/2012/06/21/7-free-geocoding-apis-google-...

Simon Georges’s picture

Version: 7.x-1.2 » 7.x-1.x-dev
drywall’s picture

Wow. Been nearly a year and still no progress on this, at least my review of 7.x-1.x-dev doesn't appear to include any updates to Yahoo.

The MapQuest nominatum plugin is also wildly out of date. Good times!

markie’s picture

@drywall
Here's a start of a patch that uses the example at http://developer.yahoo.com/boss/geo/docs/codeexamples.html#oauth_php. Also attached is the oauth,php_.txt. This needs to be placed in the plugins/geocoder_handler folder and renamed to oauth.php. The consumer key and secret key need to be added, I didn't have time to change the settings file, so just plug it into the yahoo.inc where it screams for it. This is completely untested, but a good starting point.. ping me if you have any questions.

benjy’s picture

Category: Feature request » Bug report
Priority: Major » Critical
Issue summary: View changes

@markie thanks, I had to make a couple more changes to get this working.

Replace this function with this version which checks the new place in the result set.

function _geocoder_yahoo_geometry(&$data) {
  if (!isset($data->bossresponse->placefinder->results[0]->longitude)) {
    return NULL;
  }

  return new Point($data->bossresponse->placefinder->results[0]->longitude, $data->bossresponse->placefinder->results[0]->latitude);
}

Specify the "J" flag to get a JSON result.

$args = array('flags' => 'J');
Simon Georges’s picture

Hi!
Could anybody eventually provide a full working patch, for others to review and for me to then commit?

markie’s picture

+1 for a patch request. I am not sure where that $args should go.

B-Prod’s picture

Status: Active » Needs review
FileSize
7.56 KB

This patch makes use of the new Yahoo API, for placefinder requests to work...

This means some changes in the admin UI (consumer key and secret are necessary).

B-Prod’s picture

Here is a patch against the current release (7.x-1.12). Fully tested and depoyed on a PROD environment.

Simon Georges’s picture

Thanks for the patch!
Can anybody using Yahoo test and give some feedback about the patch before I take a look on it myself?

  • phayes committed dc84942 on 7.x-2.x
    [#1800130] - update for v2 of Yahoo Placefinder API
    

  • phayes committed dc84942 on 8.x-2.x
    [#1800130] - update for v2 of Yahoo Placefinder API
    
Pol’s picture

Status: Needs review » Closed (outdated)