fatindeed / seniverse-api
PHP Client for Seniverse API
1.0.0
2019-05-17 06:33 UTC
Requires
- php: >=7.1
- guzzlehttp/guzzle: ^6.3
Requires (Dev)
- phpunit/phpunit: ^7.0 || ^8.0
This package is auto-updated.
Last update: 2024-11-17 19:54:45 UTC
README
Seniverse 账号注册
开始
composer require fatindeed/seniverse-api
配置环境变量(如.env):
SENIVERSE_UID="your public key" SENIVERSE_KEY="your private key"
或者也可以在使用时直接传入:
$weather = new SeniverseApi\Weather([ 'uid' => 'your public key', 'key' => 'your private key' ]);
城市搜索
$location = new SeniverseApi\Location; $result = $location->search('WTW3SJ5ZBJUY');
天气实况
$weather = new SeniverseApi\Weather; $result = $weather->now('WTW3SJ5ZBJUY');
逐日天气预报
$weather = new SeniverseApi\Weather; $result = $weather->daily('WTW3SJ5ZBJUY');
生活指数
$life = new SeniverseApi\Life; $result = $life->suggestion('WTW3SJ5ZBJUY');
FAQs
-
- 国内 370 个地级市
- 天气实况(2 项)
- 3 天天气预报
- 生活指数(基础 6 项)