You are here

function wunderground_weather_geolookup in Wunderground weather 7

Parameters

$location: Location to get geolookup data for.

Return value

bool|object|\stdClass Response from Wunderground Weather geolookup.

See also

http://www.wunderground.com/weather/api/d/docs?d=data/geolookup

1 call to wunderground_weather_geolookup()
wunderground_weather_location_autocomplete in ./wunderground_weather.module
Autocomplete function to get locations from the Wunderground database.

File

./wunderground_weather.module, line 820
Wunderground weather module to display weather forecasts and current weather conditions in blocks.

Code

function wunderground_weather_geolookup($location) {
  $response = FALSE;
  $request_url = 'http://api.wunderground.com/api';
  $api_key = variable_get('wunderground_weather_api_key');
  if ($api_key) {
    $request_url .= '/' . $api_key . '/geolookup/q/' . $location . '.json';
    $response = drupal_http_request($request_url);
  }
  return $response;
}