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.
A RSS Feed is available to help keep you informed on updates to the scripts.
Many of these scripts are now available on GitHub at https://github.com/ktrue
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.
Note: Twitter widget has been disabled 3-Jul-2023 since it no longer displays the recent update Tweets.
This page was updated
Friday, 22-May-2026 7:22 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:
 |
PoP: 40% ==> |
 |
 |
PoP: 100% ==> |
 |
 |
PoP: 70% ==> |
 |
To use it, you need to download the ec-forecast-V7-01.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.
 |
PoP: 40% ==> |
 |
 |
PoP: 100% ==> |
 |
 |
PoP: 70% ==> |
 |
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.
| ⚠ | Orange Warning - Air Quality |
▶ |
5:22 a.m. EDT Thursday 16 July 2026
Impact Level: High
Forecast Confidence: High
Smoke from wildfires in northwestern Ontario is causing very poor air quality and reduced visibility. Conditions may improve Friday morning.
During heavy smoke conditions, everyone's health is at risk regardless of their age or health status.
Limit time outdoors. Reschedule or cancel outdoor sports, activities and events.
You may experience mild and common symptoms such as eye, nose and throat irritation, headaches or a mild cough. More serious but less common symptoms include wheezing, chest pains or severe cough. If you think you are having a medical emergency, seek immediate medical assistance.
People more likely to be impacted by wildfire smoke, including people aged 65 and older, pregnant people, infants and young children, people with an existing illness or chronic health condition, and people who work outdoors, should avoid strenuous activities outdoors and seek medical attention if experiencing symptoms.
When indoors, keep windows and doors closed as much as possible. When there is an extreme heat event occurring with poor air quality, prioritize keeping cool.
Protect your indoor air from wildfire smoke. Actions can include using the highest quality air filter that your ventilation system can handle and/or a certified portable air cleaner that can filter fine particles.
If you must spend time outdoors, limit the time as much as possible. A well-constructed, well-fitting and properly worn respirator type mask (such as a NIOSH-certified N95 or equivalent respirator) can reduce your exposure to the fine particles in the smoke. Even though exposure may be reduced, there can still be risks to health.
Check in on others who are in your care or live nearby who may be more likely to be impacted by wildfire smoke.
Always follow guidance from local authorities.
Learn more at https://www.canada.ca/wildfire-smoke.
For further information visit the website https://www.airqualityontario.com/ or contact the Ontario Ministry of the Environment, Conservation and Parks at 416-314-6666.
Visit http://www.airhealth.ca for information on how to reduce your health risk and your personal contribution to pollution levels, as well as for current and forecast AQHI values.
Please continue to monitor alerts and forecasts issued by Environment Canada.
Issued by Environment Canada and the Province of Ontario
In effect for:- St. Catharines - Grimsby - Northern Niagara Region
Observed at: St. Catharines / Niagara District Airport Date: 4:00 PM EDT Thursday 16 July 2026 |
Smoke
|
Temp.: 29 °C
Wind: WNW 22 km/h
Humidity: 45 %
Dew point: 16 °C
Pressure: 101.4 kPa
Tendency: 0.07 kPa
Visibility: 8 km
|
Sunrise: 5:52
Sunset: 20:54
Normals: Max 26°C Min 17°C
|
|
| Extended Forecast - Environment Canada |
|
|
Fri, 17 Jul
Smoke
Max: 28°C
|
Sat, 18 Jul
Chance of showers
Max: 24°C
|
Sun, 19 Jul
A mix of sun and cloud
Max: 22°C
|
Mon, 20 Jul
Cloudy
Max: 23°C
|
Tue, 21 Jul
Chance of showers
Max: 23°C
|
Wed, 22 Jul
A mix of sun and cloud
Max: 22°C
|
Tonight
Smoke
Min: 20°C
|
Night
Chance of showers
Min: 21°C
|
Night
Chance of showers
Min: 18°C
|
Night
Clear
Min: 17°C
|
Night
Chance of showers
Min: 19°C
|
Night
Cloudy
Min: 17°C
|
Forecast
St. Catharines, ON (Issued: 3:30 PM EDT Thursday 16 July 2026)
- Tonight
- Widespread smoke. Wind northwest 20 km/h becoming light early this evening. Low 20.
- Fri, 17 Jul
- Widespread smoke. High 28. Humidex 31. UV index 9 or very high.
- Night
- A few clouds. Increasing cloudiness overnight then 40 percent chance of showers before morning. Risk of a thunderstorm before morning. Widespread smoke. Wind becoming southwest 20 km/h before morning. Low 21.
- Sat, 18 Jul
- Cloudy with 60 percent chance of showers. High 24.
- Night
- Cloudy with 30 percent chance of showers. Low 18.
- Sun, 19 Jul
- Clearing. High 22.
- Night
- Clear. Low 17.
- Mon, 20 Jul
- Cloudy. High 23.
- Night
- Cloudy with 40 percent chance of showers. Low 19.
- Tue, 21 Jul
- Cloudy with 40 percent chance of showers. High 23.
- Night
- Cloudy. Low 17.
- Wed, 22 Jul
- A mix of sun and cloud. High 22.
24 Hour Forecast - St. Catharines, ON
| Date/Time |
Temp. (°C) |
Weather Conditions |
LOP † |
Wind (km/h) |
| 16 July 2026 |
| 5 PM |
27 |
Smoke |
0 |
N 15 |
| 6 PM |
27 |
Smoke |
0 |
N 15 |
| 7 PM |
26 |
Smoke |
0 |
N 15 |
| 8 PM |
26 |
Smoke |
0 |
N 15 |
| 9 PM |
25 |
Smoke |
0 |
N 15 |
| 10 PM |
25 |
Smoke |
0 |
N 15 |
| 11 PM |
24 |
Smoke |
0 |
VR 5 |
| 17 July 2026 |
| 12 AM |
23 |
Smoke |
0 |
VR 5 |
| 1 AM |
22 |
Smoke |
0 |
VR 5 |
| 2 AM |
21 |
Smoke |
0 |
VR 5 |
| 3 AM |
21 |
Smoke |
0 |
VR 5 |
| 4 AM |
20 |
Smoke |
0 |
VR 5 |
| 5 AM |
20 |
Smoke |
0 |
VR 5 |
| 6 AM |
20 |
Smoke |
0 |
VR 5 |
| 7 AM |
20 |
Smoke |
0 |
VR 5 |
| 8 AM |
20 |
Smoke |
0 |
VR 5 |
| 9 AM |
21 |
Smoke |
0 |
VR 5 |
| 10 AM |
23 |
Smoke |
0 |
VR 5 |
| 11 AM |
24 |
Smoke |
0 |
VR 5 |
| 12 PM |
25 |
Smoke |
0 |
VR 5 |
| 1 PM |
27 |
Smoke |
0 |
VR 5 |
| 2 PM |
28 |
Smoke |
0 |
VR 5 |
| 3 PM |
28 |
Smoke |
0 |
VR 5 |
| 4 PM |
28 |
Smoke |
0 |
VR 5 |
| |
† Likelihood of Precipitation (LOP) as described in the public forecast as a chance of measurable precipitation for a period of time. Nil: 0% Low: 40% or below Medium: 60% or 70% High: Above 70%
|
|
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.
Version 5.00 is a major rewrite of the script to use the EC XML data instead of page scraping the EC website. V5.00 includes an Almanac and a 24-hour rolling forecast that can be displayed via new settings (default is to display both). The XML parsing should insulate us from further tweaks with the EC website page design as the XML format is unchanged for many years.
Version 6.00 is a major rewrite of the script to use EC JSON data instead of the deprecated XML citypage data for forecasts/alerts. The new alert display mimics that display available on the EC website with a bar for each alert that has clickable areas to expand the details of the alert as a dropdown. The $alertstring variable has the HTML and JavaScript to enable this new display.
Observed at: St. Catharines / Niagara District Airport Date: 4:00 PM EDT Thursday 16 July 2026 |
Smoke
|
Temp.: 29 °C
Wind: WNW 22 km/h
Humidity: 45 %
Dew point: 16 °C
Pressure: 101.4 kPa
Tendency: 0.07 kPa
Visibility: 8 km
|
Sunrise: 5:52
Sunset: 20:54
Normals: Max 26°C Min 17°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 26°C Min 17°C
Environment Canada Forecast PHP script: demo, in-page demo, and download package ,
download ec-forecast.php source only
download required ec-forecast-lookup.txt source only [ see version history ].
Version history
- Version 7.01 - 21-May-2026 - fixes for PHP 8.5
- Version 7.00 - 18-Dec-2025 - update for color-coded alerts
- Version 6.02 - 28-Oct-2024 - fixed alert display when there are highway alerts
- Version 6.01 - 26-Oct-2024 - fix for hourly display icons when using .png icons
- Version 6.00 - 26-Oct-2024 - rewrite to use new EC JSON return instead of XML citypage
- Version 5.07 - 02-Jul-2024 - fixes for changes in EC XML returns w/o almanac section
- Version 5.06 - 18-May-2023 - added 'advisory' alert display formatting to be same as 'statement' type display
- Version 5.05 - 09-Feb-2023 - fixes for .png icons and PHP 8.2
- Version 5.04 - 27-Dec-2022 - fixes for PHP 8.1
- Version 5.03 - 16-Oct-2019 - change XML access URL to https on EC site
- Version 5.02 - 20-Nov-2017 - added wind-gust display to conditions box and hourly display, fix no conds icon issue
- Version 5.01 - 07-Nov-2017 - added windchill display to conditions box
- Version 5.00 - 27-Sep-2017 - major rewrite of the script to use EC XML data instead of page scraping the EC website. Added Almanac and 24-hour rolling forecast displays.
- Version 4.03 - 31-Aug-2017 - fixes for icons due to EC website changes
- Version 4.02 - 22-Feb-2017 - force HTTPS to EC website, improved error handling
- Version 4.01 - 27-Oct-2016 - fix for conditions icon extract, yesterday data, use curl fetch for URL
- Version 4.00 - 22-Oct-2016 - rewrite for major EC website design changes
- Version 3.05 - 16-Dec-2015 - fixes for temperature forecast wording changes+extraction
- Version 3.04 - 14-Dec-2015 - fixes for change in EC website (chunked+gzipped response)
- Version 3.03 - 01-Dec-2015 - fixes for current conditions due to EC website changes.