my $service = OpenGbg->new->air_quality; my $response = $service->get_latest_measurement; my $measurement = $response->measurement; printf '%5.2f %s' => $measurement->temperature, $measurement->temperature_unit;
All of these attribues are decimal numbers.
For all weather attributes there is also a unit attribute (${attribute_name}_unit) that returns a textual representation the unit.
${attribute_name}_unit
The temperature (in degrees centigrade) during the measurement.
The humidity (in percent) during the measurement.
The solar insolation (in Watts/square metre) during the measurement.
The air pressure (in hPa) during the measurement.
The wind speed (in metres/second) during the mesaurement.
The wind direction (in degrees) during the measurement.
The rainfall (in mm) during the measurement.
All of these attribues are normally decimal numbers. Empty string or undef denotes missing information.
The unit for these attributes is microgram/cubic metre.
All air quality attributes also have these additional attributes:
${attribute_name}_unit returns a textual representation the unit the value is given in.
${attribute_name}_index returns a decimal number indicating the polution level for that particular attribute.
${attribute_name}_index
${attribute_name}_levels is like the *_index attribute, but in text. Values are low levels, medium levels, high levels, very high levels). Empty string/undef if the index is the empty string/undef.
${attribute_name}_levels
*_index
low levels
medium levels
high levels
very high levels
Note: The web service sometimes returns negative values for some of these measurements.
The overall Air Quality Index. Calculated from some of the other indices.
The amount of carbon monoxide in the air.
The amount of ground level ozone in the air.
The amount of nitrogen dioxide in the air.
The amount of nitrogen oxides in the air.
The amount of particulates (less than 2.5 micrometers) in the air.
The amount of particulates (less than 10 micrometers) in the air.
The amount of sulfur dioxide in the air.
Returns a string with the station data in a table.
OpenGbg::Service::AirQuality::Measurement - An air quality measurement
Version 0.1404, released 2018-05-19.
https://github.com/Csson/p5-OpenGbg
https://metacpan.org/release/OpenGbg
Erik Carlsson <info@code301.com>
This software is copyright (c) 2016 by Erik Carlsson.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install OpenGbg, copy and paste the appropriate command in to your terminal.
cpanm
cpanm OpenGbg
CPAN shell
perl -MCPAN -e shell install OpenGbg
For more information on module installation, please visit the detailed CPAN module installation guide.