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, 15-May-2013 5:10 PM

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-V2-17.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.

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.

Observed at: St. Catharines Airport
Date: 8:00 PM EDT Saturday 18 May 2013
Mostly Cloudy
Mostly Cloudy
Temperature: 15.3°C
Wind: NE 12 km/h
Humidity: 60%
Dewpoint: 7.7°C
Pressure: 102.1 kPa
Tendency: falling
Visibility: 24 km
Normals
  Max: 20°C
  Min: 9°C

Today
  Sunrise: 5:50
  Sunset: 20:37
 Extended Forecast - Environment Canada
Saturday night
Partly cloudy
 
Min: 11°C
Partly cloudy
Sunday
Chance of showers (30%)
Max: 25°C
 
Chance of showers
Monday
Chance of showers (40%)
Max: 27°C
Min: 15°C
Chance of showers
Tuesday
Chance of showers (60%)
Max: 21°C
Min: 16°C
Chance of showers
Wednesday
Showers
Max: 21°C
Min: 14°C
Showers
Thursday
Chance of showers (60%)
Max: 15°C
Min: 13°C
Chance of showers
Friday
Chance of showers (60%)
Max: 15°C
Min: 12°C
Chance of showers

Forecast

St. Catharines, ON (Issued: 3:30 PM EDT Saturday 18 May 2013)
Tonight
Partly cloudy. Wind northeast 20 km/h becoming light this evening. Low 11.
Sunday
Increasing cloudiness early in the morning. 30 percent chance of showers in the afternoon with risk of a thunderstorm. High 25. UV index 6 or high.
Sunday night
Cloudy. 30 percent chance of showers early in the evening with risk of a thunderstorm. Low 15.
Monday
A mix of sun and cloud with 40 percent chance of showers. High 27.
Tuesday
Cloudy with 60 percent chance of showers. Low 16. High 21.
Wednesday
Showers. Low 14. High 21.
Thursday
Cloudy with 60 percent chance of showers. Low 13. High 15.
Friday
Cloudy with 60 percent chance of showers. Low 12. High 15.

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.

Observed at: St. Catharines Airport
Date: 8:00 PM EDT Saturday 18 May 2013
Mostly Cloudy
Mostly Cloudy
Temperature: 15.3°C
Wind: NE 12 km/h
Humidity: 60%
Dewpoint: 7.7°C
Pressure: 102.1 kPa
Tendency: falling
Visibility: 24 km
Normals
  Max: 20°C
  Min: 9°C

Today
  Sunrise: 5:50
  Sunset: 20:37

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

 <?php
print "Normal for this date:<br/>\n";
print $conditions['normsmaxtemp'] . "<br/>\n";
print $conditions['normsmintemp'] . "\n";
?>

which would show:

Normal for this date:
Max: 20°C
Min: 9°C

Environment Canada Forecast PHP script: demo, in-page demo, and download package [ see version history ]
download script only (V2.17 - 15-May-2013), download testpage only, download README file .

 

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