snowmannunu/weather
最新稳定版本:1.0.3
Composer 安装命令:
composer require snowmannunu/weather
包简介
A weather SDK.
README 文档
README
A weather SDK
Installing
$ composer require snowmannunu/weather -vvv
Config
在使用本扩展之前,你需要去 高德开放平台 注册账号,然后创建应用,获取应用的 API Key。
Usage
use SnowmanNunu\Weather\Weather; $key = 'your key'; $weather = new Weather($key);
获取实时天气
$response = $weather->getLiveWeather('深圳');
获取近期天气预报
$response = $weather->getForecastsWeather('深圳');
Used in Laravel
在 Laravel 中使用也是同样的安装方式,配置写在 config/services.php 中:
'weather' => [ 'key' => env('WEATHER_API_KEY'), ],
在 .env 中配置 WEATHER_API_KEY :
WEATHER_API_KEY=your key
TODO
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
统计信息
- 总下载量: 6
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2023-07-03