forecast-php
Drop dead simple ~~Forecast.io API v2~~ Dark Sky API wrapper in PHP., (*1)
This lets you get from the Dark Sky API docs to the code as directly as possible., (*2)
PSR friendly and requires nothing. Abstractions not included., (*3)
Installation
Easy breezy using Composer:, (*4)
composer require guhelski/forecast-php
Usage
As simple as calling one method.
```php
<?php, (*5)
use Forecast\Forecast;, (*6)
$forecast = new Forecast('YOUR_API_KEY');, (*7)
// Get the current forecast for a given latitude and longitude
var_dump($forecast->get('37.8267','-122.423'));, (*8)
// Get the forecast at a given time
var_dump($forecast->get('37.8267','-122.423', '2013-05-06T12:00:00-0400'));, (*9)
// Use some optional query parameters
var_dump($forecast->get(
'37.8267',
'-122.423',
null,
array(
'units' => 'si',
'exclude' => 'flags'
)
)
);
```, (*10)
For more details and all available options check the official documentation., (*11)