PHP code example of survos / airnow-bundle

1. Go to this page and download the library: Download survos/airnow-bundle library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

survos / airnow-bundle example snippets


Survos\Kit\SurvosKitBundle::class => ['all' => true],
Survos\FetchBundle\SurvosFetchBundle::class => ['all' => true],
Survos\AirNowBundle\SurvosAirNowBundle::class => ['all' => true],

use Survos\AirNowBundle\Service\AirNowClient;

// Inject AirNowClient in an ordinary Symfony service/controller.
$observations = $airNow->currentObservationsByZip('20002');
$forecasts = $airNow->currentForecastsByZip('20008');
$forecasts = $airNow->currentForecastsByZip('20008', force: true);
foreach ($forecasts as $forecast) {
    // $forecast->dateValid, ->parameterName, ->aqi, ->categoryName, ->actionDay
}