floodedcodeboy / world-weather-online-laravel
Allows for easy usage of the Weather Online api in your Laravel application. Currently only the premium API is supported.
Installs: 55
Dependents: 0
Suggesters: 0
Security: 0
Stars: 4
Watchers: 2
Forks: 1
Open Issues: 1
pkg:composer/floodedcodeboy/world-weather-online-laravel
Requires
- php: >=5.3.0
- illuminate/support: 4.1.*
This package is not auto-updated.
Last update: 2022-05-23 14:42:22 UTC
README
This package is to interact with the World Weather Online API. It was developed for Laravel 4. It will return a temperature or the full weather object given a location.
Installation
- Install Composer: https://getcomposer.org/doc/00-intro.md
- Edit the composer.json file in your laravel project and add: "floodedcodeboy/world-weather-online-laravel": "dev-master" in the "require" section.
- Run "composer update"
- Get an API key with World Weather Online: http://developer.worldweatheronline.com/
- Edit the config.php file in vendor/floodedcodeboy/world-weather-online-laravel/src/config and put the API key in
- Add the Service provider in your app/config/app.php under 'providers': Floodedcodeboy\WorldWeatherOnline\WorldWeatherOnlineServiceProvider
Example Usage
In your app create the object, and call the appropriate functions.
$WorldWeatherOnline = App::make('worldweatheronline');
$location = 'London, UK';
$temperature = $WorldWeatherOnline::current_temp($location);
$condition = $WorldWeatherOnline::current_conditions($location);
$location2 = '-33.8678500, 151.2073200';
$temperature = $WorldWeatherOnline::current_temp($location2);
$condition = $WorldWeatherOnline::current_conditions($location2);