ec-forecast.php

There was an error in ec-forecast.php.
http://www.celinmeteo.com/wdisplay/wxforecast.php

Warning: Division by zero in /home/marpet100/celinmeteo.com/wdisplay/ec-forecast.php on line 1008
Warning: Invalid argument supplied for foreach() in /home/marpet100/celinmeteo.com/wdisplay/ec-forecast.php on line 1140

I have seen it to many other users.

Warning: Division by zero in /home/weathergirl70/public_html/ec-forecast.php on line 1008
Warning: Invalid argument supplied for foreach() in /home/weathergirl70/public_html/ec-forecast.php on line 1140

I have seen it to many other users.

Anyone knows who can help us remove the error.

Thank you in advance.

Marian
:frowning: #-o

Yes, it’s broken again due to a major EC website change for the forecasts.

I’m working on an update, but am on vacation visiting grandchildren so it will be on a time-as-available basis.

Don’t know why EC changes seem to take place when I’m on vacation… perhaps we should coordinate the schedules better…

Question is why these changes happen at all, in this particular case it was totally unnecessary

@ Jachym: This time I have to disagree 100%.

I maybe understand your war against “WU”, and maybe also your feelings about the changes/postponements at NOAA/NWS.

But EC is a totally different situation:
EC did not change their API => unchanged for years
EC did not change anything if you are using the normal xml feed => unchanged for years
EC uses the same xml data to display all forecasts on their own pages => in the past and still today
EC has an extensive set of documentation

What you are implying: I scrape certain EC html pages to obtain data to display on my website
AND THEREFOR EC, the owner of the website is not allowed to make any changes to their website?
OR they should warn you, the scraper, that they are going to do that?
AND at the same time, you are so knowledgable that you know that those changes are

in this particular case it was totally unnecessary

If someone is scraping html pages to use on their template / website, it is thier own fault that the scripts are not working when the html changes. Especially in this EC case as all data is available, free of charge, documented and machine readable.

Sorry, but you can not really believe those remarks in your post here and on the WX forum.
Ken was making a joke about those changes happening when he is on holiday.
I hope you were joking also.

Wim

P.S. @all
For those wanting to use the EC xml => ec-forecast.php script -- no icons -- due to major EC website changes

ec-forecast.php V4.03 is now available to fix the icon display issues with the EC website changes on 29-Aug-2017.

Please note that this is a quick fix job (since I’m on vacation), so some functionality is not implemented:

  1. the ‘*’ for Abnormal temperature trends is not working
  2. only the long Day is displayed for the icons (short day or day Mon is not implemented)

Saratoga template users: download using the update tool with a query for Base-Canada, Plugin-*, 31-Aug-2017

Standalone users: download from the script page

After the vacation, I’ll do a rewrite of the script to use the XML feeds from the EC which (as Wim notes) is MUCH more stable than the existing page-scraper.

Best regards,
Ken