function Find_Weather_Station($lat, $long) { $URL = 'http://api.openweathermap.org/data/2.5/station/find?lat=' . $lat . '&lon=' . $long . '&cnt=1'; $jsonResult = file_get_contents($URL); $result = json_decode($jsonResult, true); $station_id = $result[0]['station']['id']; $station_lat = $result[0]['station']['coord']['lat']; $station_long = $result[0]['station']['coord']['lon']; Fetch_Weather_Data($station_lat, $station_long); }
function Find_Weather_Station($lat, $long) { /* Making API calls per minute for a day */ $URL = 'http://api.openweathermap.org/data/2.5/station/find?lat=' . $lat . '&lon=' . $long . '&cnt=1'; $jsonResult = file_get_contents($URL); $result = json_decode($jsonResult, true); $station_id = $result[0]['station']['id']; $station_lat = $result[0]['station']['coord']['lat']; $station_long = $result[0]['station']['coord']['lon']; write_weather_header(); Fetch_Weather_Data($station_lat, $station_long); }