Author Topic: EC Alerts and warnings....  (Read 280 times)

0 Members and 1 Guest are viewing this topic.

Offline DW7240

  • Senior Contributor
  • ****
  • Posts: 225
    • The Vicarage Weather Feed
EC Alerts and warnings....
« on: May 10, 2020, 02:28:13 PM »
Hi,

Does anyone have a working copy of the EC Alerts / Warnings scripts, files would include wxwarnings.php, ECalertsCache.php, ECalerts_run.php, ECalerts_config.php.

Mine stopped working ages ago after the EC site got an overhaul, I know that EC changed their sites to HTTPS configuration, but just fixing that doesn't resolve the issues with the scripts.

Any help or advice would be appreciated.

Thanks in advance,

Nick.


Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9297
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: EC Alerts and warnings....
« Reply #1 on: May 10, 2020, 05:13:12 PM »
I don't think those are scripts I've authored, but.. if you'll put the scripts in question in a .zip and post it, I'll take a look.

My current ec-forecast, ec-radar and ec-lightning scripts are all working AFAIK.
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline DW7240

  • Senior Contributor
  • ****
  • Posts: 225
    • The Vicarage Weather Feed
Re: EC Alerts and warnings....
« Reply #2 on: May 10, 2020, 05:36:38 PM »
Hi Ken,

Thanks for sparing the time, these scripts are old, but have been updated up to the date of the last available update.

Basically these scripts allow the warning header to show what warnings are put out from Environment Canada in the wxwarnings.php page, one file called ECalerts_viewer shows what the ECalertsCache file has captured. Seems the Cache file is not working, but again not sure.

Hopefully you'll know what's what.

Thanks again.

Nick. dw7240.com

P.S. look at my wxwarnings.php page, under the EC WX Data button, far left on website, this will show as empty, even though there is a Frost Advisory in place from Environment Canada, as you can see on the top of the page of the website.


Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9297
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: EC Alerts and warnings....
« Reply #3 on: May 10, 2020, 06:05:41 PM »
Ok, I've done a quick pass through the code.  It looks like the ECalerts_run.php needs a couple of changes to support the HTTPS only on weather.gc.ca, and bypass any curl difficulties with host/peer SSL validation (as not all hosters have that set correctly).

change:
Code: [Select]
$WWurl = 'http://weather.gc.ca/warnings/report_e.html?';  // EC URL for Warning & Watch & Statements data *** as of December 2013 ***to:
Code: [Select]
$WWurl = 'https://weather.gc.ca/warnings/report_e.html?';  // EC URL for Warning & Watch & Statements data *** as of December 2013 ***
and change
Code: [Select]
  curl_setopt($c, CURLOPT_RETURNTRANSFER, 1);
  curl_setopt($c, CURLOPT_URL, $URL);
to
Code: [Select]
  curl_setopt($c, CURLOPT_RETURNTRANSFER, 1);
  curl_setopt($c, CURLOPT_URL, $URL);
  curl_setopt($c, CURLOPT_SSL_VERIFYPEER,0);
  curl_setopt($c, CURLOPT_SSL_VERIFYHOST,0);
  curl_setopt($c, CURLOPT_USERAGENT, "Mozilla/5.0 (EC_Alerts V3.5)");

Give those a try...
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline DW7240

  • Senior Contributor
  • ****
  • Posts: 225
    • The Vicarage Weather Feed
Re: EC Alerts and warnings....
« Reply #4 on: May 10, 2020, 07:58:45 PM »
Hi Ken,

Well I tried your suggestions and nothing, the cache file seems empty still according to the viewer file, there's output, but no warning information, just the default output when there's no warnings etc, but still the frost advisory is still active as shown at the top of the website, and can be verified by clicking the link at the bottom of wxwarnings.php to take you to EC website warning page.

Appreciate your efforts....

Nick.