cosyphp/weather
Composer 安装命令:
composer require cosyphp/weather
包简介
A weather SDK.
README 文档
README
A weather SDK..
Installing
$ composer require cosyphp/weather -vvv
Usage
<?php
require __DIR__ .'/vendor/autoload.php';
use Cosyphp\Weather\Weather;
$key = 'a775cc62fc87a9d0d9106d63b9397d41';
$w = new Weather($key);
echo "获取实时天气:\n";
$response = $w->getWeather('郑州');
echo json_encode($response, JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT);
echo "\n\n获取天气预报:\n";
$response = $w->getWeather('郑州', 'all');
echo json_encode($response, JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT);
echo "\n\n获取实时天气(XML):\n";
echo $w->getWeather('深圳', 'base', 'XML');
Contributing
You can contribute in one of three ways:
- File bug reports using the issue tracker.
- Answer questions or fix bugs on the issue tracker.
- Contribute new features or update the wiki.
The code contribution process is not very formal. You just need to make sure that you follow the PSR-0, PSR-1, and PSR-2 coding guidelines. Any new code contributions must be accompanied by unit tests where applicable.
License
MIT
统计信息
- 总下载量: 12
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 2
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2019-02-12