zmo / weather
A weather SDK
dev-master
2020-10-21 07:15 UTC
Requires
- guzzlehttp/guzzle: ^7.2
Requires (Dev)
- mockery/mockery: ^1.4
- phpunit/phpunit: ^8.0
This package is auto-updated.
Last update: 2025-04-21 17:15:13 UTC
README
A weather SDK.
Installing
$ composer require zmo/weather -vvv
Usage
use Zmo\Weather\Weather;
高德开放平台应用 API Key $key = 'mock-key'; $weather = new Weather($key);
获取实时天气 $weather->getLiveWeather('天津');
获取天气预报 $weather->getForecastsWeather('天津');
获取实时天气(XML) $weather->getWeather('天津', 'base', 'xml');
参数
array|string getWeather(string $city, string $type = 'base', string $format = 'json')
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