This is ported over from the air quality web interface. Proof I wrote this is, of course, available upon request.