webit / wwo-local-weather
World Weather Online Local Weather API PHP implementation
Installs: 62
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 3
Forks: 0
Open Issues: 0
pkg:composer/webit/wwo-local-weather
Requires
- php: >=5.3.3
- webit/weather-api: dev-master
This package is auto-updated.
Last update: 2025-09-21 00:53:52 UTC
README
What is this?
Implementation of Local Weather API from http://www.worldweatheronline.com/
Usage
$apiKey = 'your api key';
$request = new CityRequest($apiKey);
$request->setFormat(CityRequest::FORMAT_JSON); // json is default format
$request->setNumberOfDays(3); // default 2
$request->setCity('New York');
$request->setCountry('USA');
$proxy = new CurlProxy();
$response = $proxy->performRequest($request);
if($response->getSuccess()) {
echo $response->getCurrentWeather() . "\n";
foreach($response->getWeatherList() as $weather) {
echo $weather . "\n";
}
} else {
foreach($response->getErrors() as $error) {
echo $error . "\n";
}
}
TODO:
- Implementation of XML Response format
- Implementation of CSV Response format
- Tests