cloudy cloudy

Author Topic: ec-forecast.php  (Read 1469 times)

0 Members and 1 Guest are viewing this topic.

Offline M.P.C.

  • Posts: 282
  • Toronto, Ontario,Canada
  • OS/Browser:
  • Win 7/Srvr 2008R2
  • Chrome 60.0.3112.113
    • High Park Village Toronto,ON,Canada
ec-forecast.php
« on: August 30, 2017, 12:20:54 AM »
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
 :( #-o


« Last Edit: August 30, 2017, 12:58:49 AM by M.P.C. »

Online saratogaWX

  • Global Moderator
  • Posts: 5,822
  • Ken True
  • Saratoga, CA, USA 37:16:28N, 122:01:23W - Elev: 374ft.
  • OS/Browser:
  • Win NT 10.0
  • Firefox 55.0
    • Saratoga Weather
Re: ec-forecast.php
« Reply #1 on: August 30, 2017, 02:58:00 AM »
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...
Ken True
Saratoga Weather
CWOP: CW1792
WeatherUnderground: KCASARAT1
Free weather website PHP scripts and WD website AJAX templates

Offline Jachym

  • Posts: 2,092
  • Meteotemplate Developer
  • Brno, Czech Republic
    • jachym.czech
  • OS/Browser:
  • Win 7/Srvr 2008R2
  • Chrome 60.0.3112.113
    • Meteotemplate
Re: ec-forecast.php
« Reply #2 on: August 30, 2017, 10:12:15 AM »
Question is why these changes happen at all, in this particular case it was totally unnecessary

Offline wvdkuil

  • Wim van der Kuil
  • Posts: 803
  • Leuven Belgium CEST
  • OS/Browser:
  • Mac OS X 10.12.6
  • Chrome 60.0.3112.101
    • My PWS at Leuven Belgium Europe
Re: ec-forecast.php
« Reply #3 on: August 30, 2017, 11:17:09 AM »
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
Quote
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 => https://www.wxforum.net/index.php?topic=32752.msg331273#msg331273
Leuven-Template&Scripts https://support.leuven-template.eu/
My PWS at home https://weer.sluispark.be/
And at my daughters house https://www.weerstation-herent.be/

Online saratogaWX

  • Global Moderator
  • Posts: 5,822
  • Ken True
  • Saratoga, CA, USA 37:16:28N, 122:01:23W - Elev: 374ft.
  • OS/Browser:
  • Win NT 10.0
  • Firefox 55.0
    • Saratoga Weather
Re: ec-forecast.php
« Reply #4 on: August 31, 2017, 01:42:18 PM »
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
Ken True
Saratoga Weather
CWOP: CW1792
WeatherUnderground: KCASARAT1
Free weather website PHP scripts and WD website AJAX templates

Offline M.P.C.

  • Posts: 282
  • Toronto, Ontario,Canada
  • OS/Browser:
  • Win 7/Srvr 2008R2
  • Chrome 60.0.3112.113
    • High Park Village Toronto,ON,Canada
Re: ec-forecast.php
« Reply #5 on: August 31, 2017, 03:01:32 PM »
Thanks Ken!
The error has disappeared, the script works fine.
http://www.celinmeteo.com/wdisplay/wxforecast.php

 :D :D
Marian

 

cumulus