Weather Block

As you can see, I've added a weather block, showing everyone how cold it really is here in Ottawa. It's actually written from scratch by me, which I'm rather proud of.

Basically, it checks a local cache to see if the weather has been updated in the last hour. If not, it downloads the appropriate Environment Canada webpage and parses it for information (right now, just the current conditions).

These items are wrapped in just two functions -- getWeather and displayWeather. I really should have written it in OO PHP, as I've been doing for lots of stuff lately, but it started as just a quick hack.

If you want a little PHP function to display weather on your site, contact me and I can send you a copy of the source.

Comments

I don't know why these posts

I don't know why these posts are showing up as new to me, but whatever.

BTW Boris, UTC stands for Universal Coordinated Time, not Universal Time Code.  :)  Also, Ottawa is only -5 hours when we're in Standard Time, when we're observing Daylight Savings Time we're only 4 hours behind UTC.

They're showing as new becaus

They're showing as new because there are spam comments on them, which don't get published.

Interesting way to dredge up old posts, though :P

No more homemade weather

Let's just say that Environment Canada doesn't look too foundly on home made solutions. The block I made is gone, replaced with the EC-approved Flash movie.

Basically, the response was that they weren't interested in looking at other technologies at the moment, and that Macromedia was "committed to making their products accessible". I have no qualms with MM or Flash, but the blogging concept/RSS feed of weather info would be cool.

Doesn't look fondly eh?

Wonder what they'd say about the Nortel Intranet homemade solution? Did they pick on you? Maybe you should tell them to pick on someone their own size.

After much searching

I found something provided by Environment Canada -- a snippet of code that adds a Flash animation with the appropriate city information that you select.

However, I think an RSS feed of weather information would be excellent, so I sent them a feedback letter. Here's a partial quote of the email I sent:

I see that you have a PDA format for weather information, and also an interesting Macromedia Flash application. The Flash code can of course be used, but it is not particularly friendly to disabled Canadians that use screen readers or other, alternative browser devices.

What would be fantastic is an RSS (Rich Site Summary) feed of your weather information. RSS is increasingly being used to syndicate information between different sites. In many cases, it is associated with "blogging", which is a form of personal web publishing that is becoming increasingly popular. I know that many Canadian bloggers would jump at the chance to display weather information for their local area -- each reading and/or forecast could be presented as a separate item, with the opportunity to "comment" on each item. Imagine that -- Canadians talking about the weather! As well, Environment Canada could even implement a TrackBack system, showing a selected number of comments about that weather item from all over the country, or, indeed, from all over the world.

Get Safari

I haven't downloaded all the icons from the EnvCanada site yet, so about half of them are missing images.

And, if you're using Safari, it wisely just replaces the image with it's "alt" tag if it isn't available.

Man I love Safari.

Safari, paa

It is a very sad browser that does not support "alt" tags. Let me know when Apple Safari has tabs (vs windows).

Mostly cloudy is this strange picture....

Mostly cloudy is this strange picture, or lack there of with a little box and a red x in it :-p

UTC Time

The time/date codes are actually in UTC -- or universal time code. So, that's not "local" time, it's UTC. So, subtract 5 hrs from whatever time you see, and that's what time/day it is in Ottawa.

Weather in Ottawa

I just checked your "weather block" and noticed that it's -4 C which is not as cold as it was yesterday. It was 6:30 PM Pacific Time on March 15 which should be 9:30 PM in Ottawa on March 15. But the date on the weather block is March 16. - Yes, I know I am too picky sometimes!

Yes, that's correct

Yes, it's possible. If you don't believe me, click on the Environment Canada link -- it shows the same thing. My weather only updates every hour, so it is at most an hour out of date.

Ottawa Weather

I was curious about your new feature and looked at the weather this morning (9:30 AM Pacific Time, which should be around 12:30 PM Ottawa Time) and it's still the same now (midnight in Ottawa), - 11 C, mainly clear. Is that possible?