deformed-offering

Weather station scripts - Forecast Canada

They're free, but use at your own risk

The scripts referenced here are used in the operation of this weather station, and may be freely copied and used to support your station. Please note that you use these scripts at your own risk. No warranty is expressed or implied. I accept no liability for any damages that may ensue from their use.
You will need to configure them for your own particular weather station website.
RSS feed for Scripts Updates A RSS Feed is available to help keep you informed on updates to the scripts.

If you find one or more of the scripts useful to you, please consider making a donation to help offset the routine expenses of operation of this website.
Thanks for your kind support!

A Version History is available -- check back from time to time to see if there are updates to scripts you have downloaded earlier. Announcements of version updates and new scripts are made on WXForum.net and Weather-Watch forums and saratogaWXPHP Twitter account as they become available.

This page was updated Wednesday, 22-Feb-2017 11:56 AM

Environment Canada forecast script (for www.weatheroffice.gc.ca)

This script is along the lines of the carterlake.org NOAA 5-day script especially for the Canadian stations using Environment Canada as the source of the data. It uses a new set of customized icons with PoP displayed like the www.crh.noaa.gov website used by Tom's script. Examples:

Partly Cloudy PoP: 40% ==> Partly Cloudy
Rain and snow PoP: 100% ==> Rain and snow
Thunderstorm PoP: 70% ==> Thunderstorm

To use it, you need to download the ec-forecast-V4-02.zip file and unzip, then upload to your website. The scripts and GIF icons are included in the zip file. The script also requires the URL for the printable forecast for your area. Instructions are included with the source file and the ec-forecast-README.txt for the script.

As of V2.16, ec-forecast.php now supports the new transparent PNG icons created by Thayer Fox who has kindly permitted distribution from this site.
As of V3.00, the ZIP version contains these PNG icons.

Partly Cloudy PoP: 40% ==> Partly Cloudy
Rain and snow PoP: 100% ==> Rain and snow
Thunderstorm PoP: 70% ==> Thunderstorm

Download and unpack the ec-icons-png.zip and configure the ec-forecast.php to use the .png images in the settings area.

The script supports both English and French languages via the lang=en or lang=fr parameter. A live example of the French version (with lang=fr) is shown below.

SPECIAL WEATHER STATEMENT IN EFFECT

Observed at: St. Catharines Airport
Date: 1:00 PM EST Wednesday 1 March 2017
Cloudy
Cloudy
Temperature: 13.1°C
Wind: WSW 32 gust 53 km/h
Humidity: 75%
Dew point: 8.8°C
Pressure: 99.4 kPa
Tendency: Falling
Visibility: 24 km
Sunrise: 6:53 EST
Sunset: 18:05 EST
Normals:
Max 3°C. Min -5°C.
 Extended Forecast - Environment Canada
Wednesday
A few showers
A few showers
Max: 16°C
Thursday
Chance of flurries (30%)
Chance of flurries
Max: 0°C
Friday
Chance of flurries (30%)
Chance of flurries
Max: -3°C
Saturday
Sunny
Sunny
Max: 0°C
Sunday
Chance of showers (30%)
Chance of showers
Max: 5°C
Monday
Chance of showers (40%)
Chance of showers
Max: 6°C
Tuesday
Chance of flurries or rain showers (30%)
Chance of flurries or rain showers
Max: 5°C
Tonight
Chance of rain showers or flurries (60%)
Chance of rain showers or flurries
Min: -4°C
Thursday Night
Chance of flurries (30%)
Chance of flurries
Min: -6°C
Friday Night
Cloudy periods
Cloudy periods
Min: -8°C
Saturday Night
Cloudy periods
Cloudy periods
Min: -7°C
Sunday Night
Chance of showers (30%)
Chance of showers
Min: 3°C
Monday Night
Chance of flurries or rain showers (40%)
Chance of flurries or rain showers
Min: 1°C
 

Forecast

St. Catharines, ON (Issued: 11:00 AM EST Wednesday 1 March 2017)
Wednesday
Mainly cloudy. A few showers beginning this afternoon. Risk of a thunderstorm late this afternoon. Wind southwest 30 km/h gusting to 60. High 16. UV index 3 or moderate.
Wednesday night
Mainly cloudy. 60 percent chance of rain showers this evening then 60 percent chance of flurries overnight. Risk of a thunderstorm early this evening. Wind southwest 50 km/h gusting to 70 becoming northwest 50 gusting to 70 near midnight. Low minus 4.
Thursday
Mainly cloudy. 30 percent chance of flurries in the morning. Wind west 40 km/h gusting to 60 diminishing to 20 gusting to 40 near noon. High zero.
Thursday night
Cloudy periods with 30 percent chance of flurries. Low minus 6.
Friday
A mix of sun and cloud with 30 percent chance of flurries. High minus 3.
Friday night
Cloudy periods. Low minus 8.
Saturday
Sunny. High zero.
Saturday night
Cloudy periods. Low minus 7.
Sunday
Cloudy with 30 percent chance of showers. High plus 5.
Sunday night
Cloudy with 30 percent chance of showers. Low plus 3.
Monday
Cloudy with 40 percent chance of showers. High 6.
Monday night
Cloudy with 40 percent chance of flurries or rain showers. Windy. Low plus 1.
Tuesday
Cloudy with 30 percent chance of flurries or rain showers. High plus 5.

Environment Canada

With Version 1.08, a new $currentConditions string is formatted with the current conditions of the selected city. If the city's conditions are based on a nearby airport, then a current conditions icon and short weather description are included. You can enable automatic printout by using $showConditions = true; in the ec-forecast.php script which will cause it to print before the alerts and forecast section. If you're 'quitely' including the script on your page, you can still print $currentConditions; where you'd like the conditions display to appear.

Version 2.00 brings a major rewrite of the script to accomodate a major change in the EC Forecast pages. Included with the .ZIP distribution are the new icons now in use by EC for the forecast site. The V2.00 script is compatible with the prior icon set distributed with the Version 1.nn script.

Version 2.16 included multi-forecast capability, improved diagnostics, support for the new transparent PNG icons, and additional settings for display of date with icon and/or detail forecast legend.

Version 3.00 is a major rewrite to support the EC website changes in October, 2014. The .zip distribution now includes the current .PNG format weather icons with POP stamps.

Version 3.02 has a major change in display of the temperature forecasts with the icons. It is now done by an extract of the value from the detail text forecast instead of the old method of using the values from the icon HTML. This should provide a more consistent presentation of Min/Max values for the icons.

Version 4.02 now uses cURL functions and uses HTTPS to access the EC website.

Observed at: St. Catharines Airport
Date: 1:00 PM EST Wednesday 1 March 2017
Cloudy
Cloudy
Temperature: 13.1°C
Wind: WSW 32 gust 53 km/h
Humidity: 75%
Dew point: 8.8°C
Pressure: 99.4 kPa
Tendency: Falling
Visibility: 24 km
Sunrise: 6:53 EST
Sunset: 18:05 EST
Normals:
Max 3°C. Min -5°C.

You can also access the 'maxmin' for the location (where available on the EC site) by using

 <?php
print "For this date:<br/>\n";
print $conditions['maxmin'] . "<br/>\n";
?>

which would show:

For this date:
Normals: Max 3°C. Min -5°C.

Environment Canada Forecast PHP script: demo, in-page demo, and download package , download source only [ see version history ].

 

Websites using the ec-forecast.php script

16 ec-forecast.php sites listed.
If you would like your site listed please contact me with your location and weather website URL.

 

deformed-offering