Skip to content

PHP lib for reading Australian Bureau of Meteorology Weather data.

Notifications You must be signed in to change notification settings

kimpepper/bom-weather

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BOM Weather

A PHP library for fetching data from the Australian Bureau of Meteorology API.

CircleCI

Installation

composer require kimpepper/bom-weather

Usage

$logger = new NullLogger();
$client = new ForecastClient($logger);
$forecast = $client->getForecast('IDN10031');

$issueTime = $forecast->getIssueTime();

$regions = $forecast->getRegions();
$metros = $forecast->getMetropolitanAreas();
$locations = $forecast->getLocations();

foreach ($locations as $location) {
  $aac = $location->getAac();
  $desc = $location->getDescription();

  /** @var \BomWeather\Forecast\ForecastPeriod[] $periods */
  $periods = $location->getForecastPeriods();

  // Usually 7 days of forecast data.
  foreach ($periods as $period) {
    $date = $period->getStartTime();
    $maxTemp = $period->getAirTempMaximum();
    $precis = $period->getPrecis();
  }
}

Developing

PHP CodeSniffer

./bin/phpcs

PHPUnit

./bin/phpunit

About

PHP lib for reading Australian Bureau of Meteorology Weather data.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages