Download the PHP package dwr/open-weather without Composer
On this page you can find all versions of the php package dwr/open-weather. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download dwr/open-weather
More information about dwr/open-weather
Files in dwr/open-weather
Package open-weather
Short Description Simply web widget showing weather in defined location based on Open Weather API
License MIT
Homepage https://github.com//dariuszwrzesien//DwrOpenWeather
Informations about the package open-weather
DwrOpenWeather
DwrOpenWeather is a simply wrapper for Open Weather API.
In order to start please generate your personal ApiKey first.
You can do it here.
Installation and usage
When you have ApiKey, installation and usage is very easy.
Step 1: Download DwrOpenWeather using composer
Add DwrOpenWeather in your composer.json:
or download it by running the command:
Step 2: Use it in your application
GET Weather
You can get weather from OpenWeather API by using:
- getByCityName('London')
- getByCityId('2643743')
List of city ID city.list.json.gz can be downloaded here - getByGeographicCoordinates(-0.12574, 51.50853)
GET Forecast
You can get forecast from OpenWeather API by using:
- getByCityName('London')
- getByCityId('2643743')
List of city ID city.list.json.gz can be downloaded here - getByGeographicCoordinates(-0.12574, 51.50853)
Configuration (Optional)
You may configure library on your own if you like. There are several variables which you can set by yourself:
- baseUri,
- version,
- timeout,
- httpClient
- apiKey;
Examples
Take a moment and check examples directory in DwrOpenWeather. Maybe you will find there a solution which you like.
weather-basic-small
weather-basic-medium
weather-basic-large
forecast-chart
forecast-basic
License
The MIT License (MIT). Please see License File for more information.