ec-forecast.php

ec-forecast.php script does not work.
They changed the source from $ECURL = 'http://weatheroffice.gc.ca/city/pages
in http://weather.gc.ca/city/pages/


ec.jpg

Looks like the Environment Canada website has made some major changes and I’m updating the ec-forecast.php and ec-radar.php scripts to support the changes.

I’ll let you know when the updates are ready.

Best regards,
Ken

Standalone users: get source or package from http://saratoga-weather.org/scripts-ECforecast.php#ECforecast
Template users: use http://saratoga-weather.org/wxtemplates/updates.php for Base-Canada, 16-Apr-2013

Note: The EC has switched to using UTF-8 for their website so to retain the output as ISO-8859-1, a lot of iconv() calls
were added to the code. I found at least one instance of the EC posting text with mixed UTF-8 and ISO-8859-1 special characters which chokes the current PHP versions of iconv() … so if you see a detailed forecast with funny characters in it,
that’s the native UTF-8 showing as the iconv() failed … hopefully, the EC folks will use UTF-8 throughout their forecasts so that issue should be few and far between.
Also, the URLs changed from weatheroffice.gc.ca to weather.gc.ca … if you use $ECURLs with the old address, the code will replace ‘weatheroffice’ with ‘weather’ in the URL so it should work fine.

After loading up the new ec-forecast.php on your site, run the page with ?cache to refresh the cache file and your forecasts should display again.

I should have a fix for the ec-radar issue(s) tomorrow (17-Apr-2013)

Best regards,
Ken

Thanks you so much.

I am up and running again.

www.kimmirutweather.com

Thank you Ken, i am up and running again here.

Jean-Robert

I have noticed that EC is using new Icons as well, Is there a new set of icons to match?

Ken

The wxadvisory.php script is no longer working.

Jean-Robert

AQHI not getting pulled

I’ll have a fix for the missing $title used in the homepage and wxadvisory.php box and the updated ec-radar.php script on 17-Apr-2013

After that, I’ll bundle up a new set of icons for the ec-icons/ directory based on their new set.

AQHI is no longer published on the EC forecast page as values (just as a link to a different page on the site), so the AQHI won’t be provided by the ec-forecast.php script any more – I can only work with what I see on the one page from EC :slight_smile:

Best regards,
Ken