th3mouk / yahoo-weather-api
A PHP weather forecast library based on Yahoo Weather API.
Installs: 2 026
Dependents: 1
Suggesters: 0
Security: 0
Stars: 2
Watchers: 3
Forks: 3
Open Issues: 1
Requires
- php: ^5.6 || ^7.0
- guzzlehttp/guzzle: ^6.2.1
Requires (Dev)
- phpunit/phpunit: ^5.4.3
- sllh/php-cs-fixer-styleci-bridge: ^2.1
This package is auto-updated.
Last update: 2024-12-26 03:04:08 UTC
README
This PHP library providing a simple way to communicate with Yahoo Weather API.
Installation
composer require th3mouk/yahoo-weather-api ^1.0
Usage
Simply implement the class
require_once __DIR__ . '/vendor/autoload.php'; use Th3Mouk\YahooWeatherAPI\YahooWeatherAPI; $yahooWeather = new YahooWeatherAPI();
Methods
Get forecasts with a WOEID code :
$yahooWeather->callApiWoeid($woeid = null, $unit = 'c');
Get forecasts with a city name :
$yahooWeather->callApiCityName($name = null, $unit = 'c');
Get forecasts with a yql request :
$yahooWeather->callApi($yql = null);
Thanks
- To Jean-Baptiste Audebert for the first layer of code
- To peter279k for testing suite
Contributing
Before commiting, please run php-cs-fixer fix .
command, and update the test suite.
Please
Feel free to improve this library.