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.

AQI Widget screenshot

Ontario Air Quality Index widget

(For Dashboard, which is part of Mac OS X 10.4 or 10.5)

Related posts

  • No Related Posts

You can leave a response, or trackback from your own site.

7 Responses to “Ontario Air Quality Index (AQI) Widget”

  1. Anne Urbanski Says:

    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.

  2. Jason Moore Says:

    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.)

  3. Ryan Glover Says:

    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.

  4. Jason Moore Says:

    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.

  5. Ben Stone Says:

    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!

  6. Colchicine Says:

    Colchicine

    A few years ago the Ontario government built a website to inform people about the quality of air in […]

  7. Apple mac mini 2.53Ghz... Says:

    Nokia N93 Review

    With 180 grams on the scale and large size (11.8 cm long and 2.8 cm thick), the N93 is not in the

Leave a Reply