Openweathermap get forecast for multiple cities



I am using Openweathermap to get the weather forecast over the next 14 days for around 100 cities. The only (free) way I can see to do this is to query each city individually, and get the forecast. However, this takes about 25 seconds to complete.


Is there any way I query multiple cities, and/or find the forecast faster?


My PHP code is this: (where $location is the name of the city currently being queried)



$url = "http://ift.tt/1o8YE0w" . $location . ",uk&mode=xml&units=metric&cnt=" . $days;
$xml = simplexml_load_file($url);
$city = (string) $xml->location->name;


Thanks


No comments:

Post a Comment