th3mouk/yahoo-weather-api

基于Yahoo Weather API的PHP天气预报库。

1.0.0 2016-09-27 19:45 UTC

This package is auto-updated.

Last update: 2024-08-26 02:23:16 UTC


README

这个PHP库提供了一种简单的方式与Yahoo Weather API进行通信。

Latest Stable Version Latest Unstable Version Total Downloads License

SensioLabsInsight Build Status Scrutinizer Code Quality Coverage Status

安装

composer require th3mouk/yahoo-weather-api ^1.0

使用方法

简单实现类

require_once __DIR__ . '/vendor/autoload.php';

use Th3Mouk\YahooWeatherAPI\YahooWeatherAPI;

$yahooWeather = new YahooWeatherAPI();

方法

使用WOEID代码获取天气预报

$yahooWeather->callApiWoeid($woeid = null, $unit = 'c');

使用城市名称获取天气预报

$yahooWeather->callApiCityName($name = null, $unit = 'c');

使用 yql请求 获取天气预报

$yahooWeather->callApi($yql = null);

感谢

贡献

在提交之前,请运行 php-cs-fixer fix . 命令,并更新测试套件。

随时改进这个库。