Ontario Air Quality Index (AQI) Widget
A few years ago the Ontario government built a website to inform people about the quality of air in their region. I remember reading about it and thinking that this type of information would be the perfect for displaying using an ambient interface. Then I forgot all about it.
Yesterday, I stumbled onto a Dashboard widget that scrapes the Air Quality Index (AQI) from the government website and displays it in a lovely, shiny gel tile. But it didn’t work.
So, I poked around and found that Apple’s Widgets are just like Konfabulator’s widgets, which I had messed around with ages ago. It is just a directory that contains some images, css and javascript. I changed the widget to scrape the RSS feed instead of the webpage, simplified the pattern matching and made a few layout tweaks so a pollution source like “Fine Particulate Matter” still fits on the screen.
I sent a copy back to the original author, but since I’m not sure if or when I’ll hear back from them, I’m posting my new version here.
Related posts
- No Related Posts
You can leave a response, or trackback from your own site.

January 25th, 2008 at 10:45
Would it be possible to make a widget like this for Windows too? We’ve had some inquiries from the public about getting something like a widget to glean air quality information from our Wisconsin air quality website, http://dnrmaps.wi.gov/wisards.
February 3rd, 2008 at 13:41
For Windows, you’ll want to look at Yahoo Widgets. (I played around with these years ago when it was known as Konfabulator.) It’s a similar principle: A bit of javascript, XML and some images get combined to make your widget.
As for hooking it up to your website, you’ll need to create a feed that is easy to parse. (It’s possible to scrape data from an HTML table, but it would be a lot easier if it was in an RSS file or even better a JSON string.)
March 25th, 2008 at 9:54
This is a great update, thanks. I don’t think I ever got your email. When I originally made the widget the MOE didn’t offer an RSS feed and so I was forced to jump through some convoluted pattern matching to extract the AQI. I think that the MOE changed the html on their listing page and that broke the original code. Your RSS version is so much faster, great work.
April 11th, 2008 at 21:36
Hey Ryan, glad you found my version of your widget. Yeah, I figured the RSS feed probably came later much later, and it certainly made things easier. Feel free to incorporate my changes if you’re thinking of doing a new release.
May 11th, 2008 at 20:47
Excellent widget, thanks for sharing with the “community”. Could I hire you to do a custom widget that pulled the same info from a similar US database for Phoenix? I’d be happy to pay to have this done!