destcable/weather-php
最新稳定版本:v1.1.6
Composer 安装命令:
composer require destcable/weather-php
包简介
WeatherPHP: Powerful library for integrating weather data. Get up-to-date weather information with ease, query a variety of weather sources, and integrate forecasts and weather data into your web applications with minimal effort.
README 文档
README
Usage
To work with the library, you need to register on the https://openweathermap.org platform, after which you will receive an authorization key (it is free), and insert this key during initialization as shown in the example.
use WeatherPHP\Weather; $weather = new Weather( apiKey: 'you_api_key'); $weather->language = 'ru'; $weather->find( city: 'San Francisco' ); $weather->getTemperature();
Getting the weather in time difference, the maximum amount in days that can be obtained +5 from the current date.
use WeatherPHP\Weather; $weather = new Weather( apiKey: 'you_api_key'); $weather->getDaysTemperature( city: 'Москва', days: 5 );
Planning an event and up to 5 days, if the event is large for 5 days (an error will occur, because at the moment working with the scheduler for more than 5 days is not provided).
use WeatherPHP\Weather; $event = new Event( name: 'Playing football with friends', city: 'Moscow', date: '2023-08-30 12:00', expectedWeather: 'Sunny' );
统计信息
- 总下载量: 24
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2023-08-24