Author Topic: Enviro Canada web developers have been busy .... Radar and Forecast  (Read 18056 times)

0 Members and 1 Guest are viewing this topic.

Offline mackbig

  • Forecaster
  • *****
  • Posts: 4128
    • Mackie's Main Street, Unionville, ON Canada Weather
Ken,
EC changed their site around, and the EC Forecast and Radar scripts are not working.
The radar one causes notices and warnings, the forecast is just null.

Let us know when you get a chance to have a look.

Thanks,
Andrew

Andrew - Davis VP2+ 6163, serial weatherlink, wireless anemometer, running Weather Display.  Boltek PCI Stormtracker, Astrogenic Nexstorm, Strikestar - UNI, CWOP CW8618, GrLevel3, (Station 2 OS WMR968, VWS 13.01p09), Windows 7-64

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9279
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Enviro Canada web developers have been busy .... Radar and Forecast
« Reply #1 on: April 16, 2013, 01:53:49 PM »
Yep.. they've changed the website URL, and switched to UTF-8 for the charset (from ISO-8859-1).

I'll have to do some changes to both scripts.. working on it right now.

Best regards,
Ken
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 weathergirl

  • Forecaster
  • *****
  • Posts: 677
    • Beamsville Weather Station
Re: Enviro Canada web developers have been busy .... Radar and Forecast
« Reply #2 on: April 16, 2013, 01:56:29 PM »
Just saw the mess on my site, thanks for getting right on it, Ken :)
Ann-Marie
Beamsville, Ontario, Canada

Offline linuxfreak

  • Hamilton Central Mountain Weather
  • Senior Contributor
  • ****
  • Posts: 188
  • Wink, wink!
    • Hamilton Central Mountain Weather
Re: Enviro Canada web developers have been busy .... Radar and Forecast
« Reply #3 on: April 16, 2013, 06:51:35 PM »
Well, at least they haven't mucked with the weather radio broadcasts yet.   :shock: #-o :lol:

I just noticed the dashboard threw errors, guess a rewrite is needed for my EC-radar addon for NSDisplay!  ](*,) #-o

And I was just beginning to like spring!  :roll:

George

George
Davis VP2/FARS, VVP, WD, WL, WSWin, Cumulus, NexStorm, StrikeStar, NSLog, XPort(GPS), WASP2, DigitalAtmosphere, ScannerCast(WUradio), Intel Atom N330 dual-core, 2Gig ram, Windows XP Home SP3  #-o
CWOP - DW3112, PWS & WU - IONHAMIL2, AWEKAS - 5112, COWN, WML - WD01901

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9279
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Enviro Canada web developers have been busy .... Radar and Forecast
« Reply #4 on: April 16, 2013, 07:08:40 PM »
Yes, ec-radar is next on my rework list based on Environment Canada changes today (16-Apr-2013)

I have completed the needed mods to ec-forecast.php (V2.14 - 16-Apr-2012)

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
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 weathergirl

  • Forecaster
  • *****
  • Posts: 677
    • Beamsville Weather Station
Re: Enviro Canada web developers have been busy .... Radar and Forecast
« Reply #5 on: April 16, 2013, 07:25:29 PM »
Thanks for the fix, Ken =D> I notice they're using new icons as well:

http://weather.gc.ca/city/pages/on-47_metric_e.html
Ann-Marie
Beamsville, Ontario, Canada

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9279
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Enviro Canada web developers have been busy .... Radar and Forecast
« Reply #6 on: April 16, 2013, 07:29:34 PM »
I'll do a new icons set after the ec-radar script fixes :)

Best regards,
Ken
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 weathergirl

  • Forecaster
  • *****
  • Posts: 677
    • Beamsville Weather Station
Re: Enviro Canada web developers have been busy .... Radar and Forecast
« Reply #7 on: April 16, 2013, 07:32:02 PM »
Yay!!! Thanks, Ken \:D/
Ann-Marie
Beamsville, Ontario, Canada

Offline weathergirl

  • Forecaster
  • *****
  • Posts: 677
    • Beamsville Weather Station
Re: Enviro Canada web developers have been busy .... Radar and Forecast
« Reply #8 on: April 16, 2013, 08:10:07 PM »
Ken, I also noticed that the watches/warnings alerts bar is not displaying my location:

http://www.beamsvillewx.ca/index.php
Ann-Marie
Beamsville, Ontario, Canada

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9279
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Enviro Canada web developers have been busy .... Radar and Forecast
« Reply #9 on: April 16, 2013, 08:12:48 PM »
What was the code on your index.php that did the alerts display?  (BTW.. there aren't any alerts for your location right now)
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 weathergirl

  • Forecaster
  • *****
  • Posts: 677
    • Beamsville Weather Station
Re: Enviro Canada web developers have been busy .... Radar and Forecast
« Reply #10 on: April 16, 2013, 08:16:43 PM »
Code: [Select]
if ($alertstring <> '') {
print $alertstring; // will produce alert box with link if advisories found
} else {
print "<p class=\"advisoryBox\">".langtransstr("No watches or warnings in effect for")." $title.</p>\n";

Ann-Marie
Beamsville, Ontario, Canada

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9279
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Enviro Canada web developers have been busy .... Radar and Forecast
« Reply #11 on: April 16, 2013, 08:19:52 PM »
I'll look at why $title is not being found later this evening. 

Best regards,
Ken
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 PaulMy

  • Forecaster
  • *****
  • Posts: 5519
    • KomokaWeather
Re: Enviro Canada web developers have been busy .... Radar and Forecast
« Reply #12 on: April 16, 2013, 10:23:29 PM »
Quote
I have completed the needed mods to ec-forecast.php (V2.14 - 16-Apr-2012)
Thanks for the quick fix Ken, my EC forecast is back.
Quote
I should have a fix for the ec-radar issue(s) tomorrow (17-Apr-2013)
And as expected until you can get a fix for this, the radar is not working .

Quote
Ken, I also noticed that the watches/warnings alerts bar is not displaying my location:
We have no current watches or warnings and my home page does show the yellow bar with "No weather watches or warnings in effect for ,"

Also I did notice from my StatCounter that I had some visits from Environment Canada IP address earlier this morning,
Quote
www.google.ca — wxlink canada
which I have not seen before.

Paul

Offline mackbig

  • Forecaster
  • *****
  • Posts: 4128
    • Mackie's Main Street, Unionville, ON Canada Weather
Re: Enviro Canada web developers have been busy .... Radar and Forecast
« Reply #13 on: April 17, 2013, 06:32:36 AM »
Thanks Ken

Andrew

Andrew - Davis VP2+ 6163, serial weatherlink, wireless anemometer, running Weather Display.  Boltek PCI Stormtracker, Astrogenic Nexstorm, Strikestar - UNI, CWOP CW8618, GrLevel3, (Station 2 OS WMR968, VWS 13.01p09), Windows 7-64

Offline mackbig

  • Forecaster
  • *****
  • Posts: 4128
    • Mackie's Main Street, Unionville, ON Canada Weather
Re: Enviro Canada web developers have been busy .... Radar and Forecast
« Reply #14 on: April 17, 2013, 09:56:06 AM »
Strange.  It worked after I deleted the old ec-forecast-en.txt file.

Then a few hours laters, I went back in and it created a new null one again. Hmmm?

Andrew

Andrew - Davis VP2+ 6163, serial weatherlink, wireless anemometer, running Weather Display.  Boltek PCI Stormtracker, Astrogenic Nexstorm, Strikestar - UNI, CWOP CW8618, GrLevel3, (Station 2 OS WMR968, VWS 13.01p09), Windows 7-64

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9279
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Enviro Canada web developers have been busy .... Radar and Forecast
« Reply #15 on: April 17, 2013, 11:33:24 PM »
I have finished with the updates to support Environment Canada's new website design.   :D

ec-forecast.php V1.15 - 17-Apr-2013
  fixes the $title issue so alerts will show the name of the city
  Standalone users: get source or package from http://saratoga-weather.org/scripts-ECforecast.php#ECforecast

ec-radar.php V1.09 - 17-Apr-2013
  changes for new EC website design, UTF-8 to ISO-8859-1 conversion and a modified method for the /radar/ directory
  Standalone users: get source or package from http://saratoga-weather.org/scripts-ECradar.php#ECradar

Template users can get both scripts using the update tool for Base-Canada, 17-Apr-2013

Best regards,
Ken
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 PaulMy

  • Forecaster
  • *****
  • Posts: 5519
    • KomokaWeather
Re: Enviro Canada web developers have been busy .... Radar and Forecast
« Reply #16 on: April 18, 2013, 12:51:33 AM »
Great, and seems to be working properly again.  Thanks again Ken.

Paul

Offline mackbig

  • Forecaster
  • *****
  • Posts: 4128
    • Mackie's Main Street, Unionville, ON Canada Weather
Re: Enviro Canada web developers have been busy .... Radar and Forecast
« Reply #17 on: April 18, 2013, 07:14:55 AM »
Ken,
The radar script worked great.

I have this recurring problem with the forecast script.  It will work for a while.  Then my http://www.mackweather.com/ec-forecast-en.txt will end up like this below.

Code: [Select]
HTTP/1.1 301 Moved Permanently
Date: Thu, 18 Apr 2013 11:05:15 GMT
Server: Apache
Location: http://weather.gc.ca/city/pages/on-85_metric_e.html
Vary: Accept-Encoding
Content-Length: 259
Connection: close
Content-Type: text/html; charset=iso-8859-1
X-Pad: avoid browser bug

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>301 Moved Permanently</title>
</head><body>
<h1>Moved Permanently</h1>
<p>The document has moved <a href="http://weather.gc.ca/city/pages/on-85_metric_e.html">here</a>.</p>
</body></html>

I will go into ftp, delete it, then it will work for a while, then revert. 

Thanks
Andrew

Andrew - Davis VP2+ 6163, serial weatherlink, wireless anemometer, running Weather Display.  Boltek PCI Stormtracker, Astrogenic Nexstorm, Strikestar - UNI, CWOP CW8618, GrLevel3, (Station 2 OS WMR968, VWS 13.01p09), Windows 7-64

Offline weathergirl

  • Forecaster
  • *****
  • Posts: 677
    • Beamsville Weather Station
Re: Enviro Canada web developers have been busy .... Radar and Forecast
« Reply #18 on: April 18, 2013, 10:17:02 AM »
Great work, Ken, thanks. Have a look at my radar page-

http://www.beamsvillewx.ca/wxradar.php

The size of the map keeps changing  :???:

Ann-Marie
Beamsville, Ontario, Canada

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9279
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Enviro Canada web developers have been busy .... Radar and Forecast
« Reply #19 on: April 18, 2013, 11:03:26 AM »
Ken,
The radar script worked great.

I have this recurring problem with the forecast script.  It will work for a while.  Then my http://www.mackweather.com/ec-forecast-en.txt will end up like this below.

Code: [Select]
HTTP/1.1 301 Moved Permanently
Date: Thu, 18 Apr 2013 11:05:15 GMT
Server: Apache
Location: http://weather.gc.ca/city/pages/on-85_metric_e.html
Vary: Accept-Encoding
Content-Length: 259
Connection: close
Content-Type: text/html; charset=iso-8859-1
X-Pad: avoid browser bug

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>301 Moved Permanently</title>
</head><body>
<h1>Moved Permanently</h1>
<p>The document has moved <a href="http://weather.gc.ca/city/pages/on-85_metric_e.html">here</a>.</p>
</body></html>

I will go into ftp, delete it, then it will work for a while, then revert. 

Thanks
Andrew

Very strange .. the 301 redirects to exactly the same URL ?!? -- I think this is a weather.gc.ca website problem. 
They appear to have two server addresses
Quote
04/18/13 07:59:29 dns weather.gc.ca
Canonical name: weather.gc.ca
Addresses:
  199.212.17.39
  199.212.17.28
and maybe this is a load balancing attempt if they are doing round-robin DNS for load balancing.

Great work, Ken, thanks. Have a look at my radar page-

http://www.beamsvillewx.ca/wxradar.php

The size of the map keeps changing  :???:


I tried the page, and there are 3 different map sizes with their new website.
The NAT is 600x522px, the regional ones are 573x300px and the individual radar sites are 580x480px

Is that what you meant by 'the size of the map keeps changing'?

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 weathergirl

  • Forecaster
  • *****
  • Posts: 677
    • Beamsville Weather Station
Re: Re: Enviro Canada web developers have been busy .... Radar and Forecast
« Reply #20 on: April 18, 2013, 11:14:53 AM »
Yes.  I  have my ec-radar.php page set for my local radar, not the national or provincial radar,  so I wonder why it's displaying the national radar?
Ann-Marie
Beamsville, Ontario, Canada

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9279
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Enviro Canada web developers have been busy .... Radar and Forecast
« Reply #21 on: April 18, 2013, 12:37:47 PM »
Just did an update to wxadvisory.php for Base-Canada to fix the warning image overflow and correct links for new EC website design.

The wxadvisory.php main copy area now has
Code: [Select]
<div id="main-copy">
 
 
  <div align="center">       
<?php 
 $doInclude    = true// handle ec-forecast and WXSIM include also
 $doPrint    = false//  ec-forecast.php setting
 include_once($SITE['fcstscript']);
 if ($alertstring <> '') { 
 print $alertstring// will produce alert box with link if advisories found
 } else { 
 print "<p class=\"advisoryBox\">".langtransstr("No watches or warnings in effect for").$title.</p>\n"
 }
?>

<?php 
if(preg_match('|narrow|',$SITE['CSSscreen'])) {
$wtext 'width="610" height="523"'
} else {
$wtext 'width="852" height="731"'
}
if(
$SITE['lang'] == 'fr') {$L 'f'; } else {$L 'e'; } ?>

<a href="http://weather.gc.ca/warnings/index_<?php echo $L?>.html" style="border: none">
<img src="http://weather.gc.ca/data/download/canada.png" style="border:none;" <?php echo $wtext?> alt="national advisories"/></a>
<?php if($SITE['lang'] == 'fr') { $legend 'CanadaLegend-fr.gif'; } else { $legend 'CanadaLegend-en.gif'; } ?>
<img src="<?php echo $legend;?>" alt="National Advisory Legend" title="National Advisory Legend"/>
<?php print "<p><a href=\"$ECURL\">$ECNAME</a></p>\n"?>
  </div>
 
 
</div><!-- end main-copy -->

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 saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9279
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Enviro Canada web developers have been busy .... Radar and Forecast
« Reply #22 on: April 18, 2013, 12:40:40 PM »
Yes.  I  have my ec-radar.php page set for my local radar, not the national or provincial radar,  so I wonder why it's displaying the national radar?

Your Settings.php has
Code: [Select]
// radar settings for wxradar.php page
$SITE['ecradar']    = 'NAT';  // set to default Site for ec-radar (same as id=xxx on EC website)
so that is the default map that will be displayed on the wxradar.php page.

Best regards,
Ken

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 weathergirl

  • Forecaster
  • *****
  • Posts: 677
    • Beamsville Weather Station
Re: Enviro Canada web developers have been busy .... Radar and Forecast
« Reply #23 on: April 18, 2013, 02:01:10 PM »
Have made the change to my Settings.php and ec-radar.php. My index page still has errors. I chose 'ONT' as my radar in my index.php.
Ann-Marie
Beamsville, Ontario, Canada

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9279
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Enviro Canada web developers have been busy .... Radar and Forecast
« Reply #24 on: April 18, 2013, 02:04:20 PM »
Ann-Marie,
The messages
Quote
Notice: Undefined offset: 0 in /homepages/22/d364066440/htdocs/maps/ec-radar.php on line 265

Notice: Undefined offset: 0 in /homepages/22/d364066440/htdocs/maps/ec-radar.php on line 274

Notice: Undefined offset: 0 in /homepages/22/d364066440/htdocs/maps/ec-radar.php on line 275

Notice: Undefined offset: 0 in /homepages/22/d364066440/htdocs/maps/ec-radar.php on line 276
are there because the ec-radar.php in the /maps/ directory is the old one (not the updated one)

I suggest you either update the script in that directory, or better still, change the index.php to use the
new script in your home directory instead.

Best regards,
Ken
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