php-weather/tomorrow

Tomorrow.io 提供商

0.2.2 2024-02-27 19:48 UTC

This package is auto-updated.

Last update: 2024-09-27 21:05:38 UTC


README

Packagist Version
PHP Weather Common Version PHP Weather HTTP Provider Version
GitHub Release Date GitHub commits since tagged version GitHub last commit
GitHub Workflow Status GitHub Packagist PHP Version Support

这是来自 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);