Local Radar - KMUX - GRLevel3

Saratoga-Weather.org

Weather station scripts - Forecast Canada

They're free, but use at your own risk

The scripts in PHP and Perl 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 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 small donation to help offset the routine expenses of operation of this website. Thanks for your kind support! live chat

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 as they become available.

This page was updated Thursday, 05-Jun-2008 1:14 PM

PHP Scripts (run on webserver)

These scripts have run on PHP 4.1.2, and PHP 4.4.1. I don't have access to PHP 3.x, so it is not known if they will work on versions below PHP 4.1.2. If you try them and they work (or not) on earlier versions of PHP, please send me a message at webmaster[at]saratoga-weather.org and let me know the results.

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-06.zip file and unzip, then upload to your website. The scripts and 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.

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.

AVERTISSEMENT DE PLUIE VERGLAÇANTE MAINTENU

Auj.

Neige fondante intermittente
Max: 2°C
Min: -6°C
Neige fondante intermittente
Jeu

Neige intermittente
Max: -4°C
Min: -4°C
Neige intermittente
Ven

Alternance de soleil et de nuages
Max: -3°C
Min: -5°C
Alternance de soleil et de nuages
Sam

Pluie ou neige
Max: 3°C
Min: -3°C
Pluie ou neige
Dim

Alternance de soleil et de nuages
Max: -6°C
Min: -7°C
Alternance de soleil et de nuages

Textes des prévisions

Lincoln (émises à : 5h00 HNE le mercredi 7 janvier 2009)
AVERTISSEMENT DE PLUIE VERGLAÇANTE MAINTENU
Aujourd'hui
Jour: Neige fondante intermittente se changeant en neige intermittente cet après-midi. Risque de pluie verglaçante ce matin. Accumulation de neige de 2 cm. Vents devenant d'ouest à 20 km/h tôt cet après-midi. Maximum plus 2.
Nuit: Neige intermittente. Accumulation de 2 à 4 cm. Poudrerie par endroits au cours de la nuit. Vents du sud-ouest de 20 km/h devenant d'ouest à 40 avec rafales à 60 vers minuit. Minimum moins 6.
Jeudi
Neige intermittente cessant en fin de journée. Passages nuageux par la suite. Accumulation de 2 à 4 cm. Poudrerie par endroits en matinée. Vents d'ouest de 40 km/h avec rafales à 60 diminuant à 20 tôt le matin. Températures stables près de moins 4.
Vendredi
Alternance de soleil et de nuages. Minimum moins 5. Maximum moins 3.
Samedi
Pluie ou neige. Minimum moins 3. Maximum plus 3.
Dimanche
Alternance de soleil et de nuages. Minimum moins 7. Maximum moins 6.

Environnement 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.

Enregistrées à: Vineland Station
Date: 7h00 HNE mercredi 7 janvier 2009
Température: -0,1°C
Vent: ESE 3 km/h
Humidité: 98 %
Point de rosée: -0,4°C
Pression: 99,0 kPa
Tendance: à la baisse
Lever du soleil: 7:50
Coucher du soleil: 16:59

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: 0°C
Min: -8°C

Environment Canada Forecast PHP script: demo, in-page demo, and download package [ see version history ]
download script only (V2.06 - 05-Jun-2008), download testpage only, download README file .

 

Websites using the ec-forecast.php script

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

 

Weather Station Finder USA Weather Finder  ©2006-2007 Saratoga Weather.org   Privacy Statement
Radar/maps © Weather Underground. Used with permission.    Valid XHTML 1.0     Valid CSS
Never base important decisions that could result in harm to people or property on this weather information.