Skip to content

Instantly share code, notes, and snippets.

@craigchang
craigchang / purpleair.js
Last active September 29, 2021 05:26
Purple Air Scriptable Widget for iOS
// purpleair.js
// Depending on a user selection, performs one of two actions:
// 1. Compute the air quality index for the sensor id the air quality index (AQI) for the sensor id provided in a param
// 2. Presents a UI to browse air quality information retrieved from Purple Air REST API
// Reference: https://en.wikipedia.org/wiki/Air_quality_index
// Future enchancements
// 1. Increase/Decrease indicator