mbajda/yahoo-weather
Composer 安装命令:
composer require mbajda/yahoo-weather
包简介
Yahoo Weather API PHP Implementation
README 文档
README
This library is a PHP implementation of Yahoo Weather API. It allows querying for many weather conditions for specified location on the world.
Usage
First, you need to create instance of weather API endpoint. To do this, simply use following code:
$cache = new \YahooWeather\Endpoint\Cache\FileCache('var\cache', 60*60*12); $endpoint = new \YahooWeather\Endpoint($cache);
YahooWeather\Endpoint is the main class of the library.
YahooWeather\Endpoint\Cache\FileCache is the cache class to use with the endpoint. The constructor accepts up to 2 parameters. The first is the directory, in which the cache will be stored. The second is cache time-to-live - the time, for which the cache file will be used.
$endpoint->getWOEIDs('Warsaw');
This line will allow you to get WOEID (location's ID) for a specified location.
$endpoint->getData(523920);
getData method allows you to get all the data for specified WOEID (which is the parameter for that and other methods).
Additional information
The library utilizes connection with https://query.yahooapis.com - Yahoo APIs. There is a limit of queries made by day, which is equal to 2000.
Read more at https://developer.yahoo.com/weather
统计信息
- 总下载量: 25
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 3
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2017-09-18