php-weather / tomorrow
Tomorrow.io 提供商
0.2.2
2024-02-27 19:48 UTC
Requires
- php: ^8
- ext-json: *
- php-weather/core: ^0.4
- php-weather/http-provider: ^0.6
Requires (Dev)
- php-http/guzzle7-adapter: ^1.0
- phpstan/phpstan: ^1.6
- phpunit/phpunit: >=8.0
README
这是来自 PHP Weather 的 Tomorrow.io 提供商。
Tomorrow.io 的天气 API 提供快速、可靠和高度准确所需的天气数据,具有将此数据源集成到任何应用程序、系统或程序的灵活性。
安装
通过 Composer
composer require php-weather/tomorrow
使用方法
$tomorrowKey = 'key'; $httpClient = new \Http\Adapter\Guzzle7\Client(); $tomorrowIo = new \PhpWeather\Provider\Tomorrow\Tomorrow($httpClient, $tomorrowKey); $latitude = 47.873; $longitude = 8.004; $currentWeatherQuery = \PhpWeather\Common\WeatherQuery::create($latitude, $longitude); $currentWeather = $tomorrowIo->getCurrentWeather($currentWeatherQuery);