/** * Scrape the API * * @param string $location Location to geocode * @return GeocodeError|LatLng Returns a GeocodeError on error, LatLng on success. */ private static function scrapeAPI($location, $key) { $url = sprintf("https://maps.googleapis.com/maps/api/geocode/json?address=%s&key=%s", urlencode($location), $key); $response = json_decode(Scraper::scrape($url)); return $response; }
/** * Scrape the API * * @param string $location Location to geocode * @return GeocodeError|LatLng Returns a GeocodeError on error, LatLng on success. */ private static function scrapeAPI($location) { $url = sprintf("http://maps.google.com/maps/api/geocode/json?address=%s&sensor=false", urlencode($location)); $response = json_decode(Scraper::scrape($url)); return $response; }