brookedot/weather-machine
最新稳定版本:v1.0.1
Composer 安装命令:
composer require brookedot/weather-machine
包简介
PHP wrapper for the Weather Machine API
README 文档
README
A PHP wrapper for the Weather Machine API.
Uses Sympfony HTTP Client.
Installation
composer require brookedot/weather-machine
Usage
use BrookeDot\WeatherMachine\WeatherMachine; $weather = new WeatherMachine('your-api-key'); // Get hourly forecast $hourly = $weather->location(47.608013, -122.335167) ->source('mock') ->units('si') ->hourly(); // Get current conditions $current = $weather->location(47.608013, -122.335167) ->source('open_weather') ->currently(); // Get daily forecast $daily = $weather->location(47.608013, -122.335167) ->source('open_weather') ->daily();
Available Methods
Required
location(float $lat, float $lon)- Set coordinatessource(string $source)- Set weather data source (defaults to 'mock')
Optional
units(string $unit)- Set units: us, si, ca, uk, m (default: us)output(string $format)- Set output format: base, full (default: base)
Data Retrieval
get()- Get full responsecurrently()- Get current conditionshourly()- Get hourly forecastdaily()- Get daily forecastminutely()- Get minutely forecastalerts()- Get weather alerts
Available Sources
- accuweather
- aeris_weather
- apple_weather
- custom_weather
- foreca
- mock
- open_weather
- pirate_weather
- the_weather_company
- tomorrow_io
- visual_crossing
- weatherbit
License
AGPL V3 or later License - see LICENSE file for details.
统计信息
- 总下载量: 10
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: AGPL-3.0
- 更新时间: 2025-12-15