zmo/weather

dev-master 2020-10-21 07:15 UTC

This package is auto-updated.

Last update: 2024-04-21 15:01:04 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:

  1. File bug reports using the issue tracker.
  2. Answer questions or fix bugs on the issue tracker.
  3. 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