2017 © Pedro Peláez
 

library wwo-local-weather

World Weather Online Local Weather API PHP implementation

image

webit/wwo-local-weather

World Weather Online Local Weather API PHP implementation

  • Monday, September 16, 2013
  • by dbojdo
  • Repository
  • 3 Watchers
  • 0 Stars
  • 56 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

World Weather Online - Local Weather API implementation

What is this?

Implementation of Local Weather API from http://www.worldweatheronline.com/, (*1)

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

The Versions

16/09 2013

dev-master

9999999-dev

World Weather Online Local Weather API PHP implementation

  Sources   Download

MIT

The Requires

 

weather weather api wwo