Weather Website Scripts

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 and Weather-Watch forums and saratogaWXPHP Twitter account as they become available.

This page was updated Sunday, 08-Oct-2017 9:58 PM

Google mesomap display

The Affiliated Regional Weather Networks have been quite popular, and now it is possible for you to add a Google map display of conditions from around the world to your own website. We do prefer that the script(s) be used by members who contribute their data to a Regional Weather Network. Version 2 of the script uses the Google Maps API V3 code and now requires a Google Map Browser JavaScript API Key for operation.

Here's a sample of the display:

Affiliated Regional Weather Networks


[Weather, Webcam, Lightning] Weather, Lightning, WebCam, [Weather, Lightning] Weather, Lightning, [Weather, Webcam] Weather, WebCam, [Weather] Weather

About the Global Map

This Google Map shows the locations of current affiliated regional weather network member stations.

cluster marker image Markers with numbers indicate clusters of stations - click to zoom the map to show station markers. If you click on a marker for a station, a descriptive window will open and show the station features, a link to the station's homepage, the regional network affiliations for the station, and current conditions at the station (where available).

Affiliated Regional Weather Networks

1640 stations in affiliated networks worldwide as of 2018-07-20 16:06:48 UTC

Map data from Affiliated Regional Networks and scripts from
If you have a personal weather station publishing to a personal weather website, you can submit a request to have your data included in this display by visiting the network for your geography from the list above.

Note: in the sample above, the network list links are NOT with target="_blank" to open in a new window/tab since this website is XHTML 1.0-Strict and that attribute is disallowed. The links in the popup windows for the markers are generated with target="_blank" since the validator cannot process JavaScript-generated HTML :)..


The map package (below) comes in 3 basic configurations:

  • A HTML/JavaScript package
  • A PHP/JavaScript package
  • A plugin for the Saratoga AJAX/PHP templates (V2 and V3 compatible)

Note: As of 22-Jun-2016, you need a Google Map Browser JavaScript API KEY to run this script
Generate the key from the Google Console:
then change quake-json.php (if not running in the Saratoga template):

$googleAPI = '-replace-this-with-your-API-key-here-';

if you are using the Saratoga template set, then just put a new entry in Settings.php with:

$SITE['googleAPI'] = '-replace-this-with-your-API-key-here-';

The PHP versions include two support scripts (global-links.php and global-conditions-json.php ) to help minimize the access time to draw your map page by caching some files from the Affiliated Regional Weather Networks home site locally on your website. These files are

  • network-list-inc.html
  • network-links-inc.html
  • member-count.txt
  • members-list-inc.html
  • global-conditions.json

Starter files of the above are included with the PHP distributions with content that lets you know that the cache file has not been written. Depending on your PHP installation, the above files may need to have permissions set to 666 (write/read by all) in order for the caching to work. If you do a 'view-source' on the PHP page with the scripts in it, it should show any error messages encoutered as HTML comments.

For the plugin for the AJAX/PHP multilingual templates (V2 or V3) you may need to add to your language-LL-local.txt files the translations for:

langlookup|Global Station Map|Global Station Map|
langlookup|Global Station Map of Affiliated Weather Networks|Global Station Map of Affiliated Weather Networks|
langlookup|Weather, Lightning, WebCam|Weather, Lightning, WebCam|
langlookup|Weather, WebCam, Lightning|Weather, WebCam, Lightning|
langlookup|Weather, Lightning|Weather, Lightning|
langlookup|Weather, WebCam|Weather, WebCam|
langlookup|Conditions not available|Conditions not available|
langlookup|About the Global Map|About the Global Map|
langlookup|Affiliated Regional Weather Networks|Affiliated Regional Weather Networks|

Which will allow for the translation of the headings and pop-up station data boxes to language LL. You may also need to copy wxglobal-en.html to wxglobal-LL.html and translate the text inside from English to language LL so the rest of the page will display correctly. Be sure to use the correct character set for your page to match the other translation files used by the Multilingual templates. The multilingual plugin will also read the corresponding language-LL.js JavaScript so the conditions, wind-directions and barometric pressure trend can be translated in the popup conditions windows.
Note: if you create a translation for the multilingual template map, please let me know so I can include it in the global-map-template-ML distribution so others can use it too. Thanks in advance!

Customize the appropriate page (HTML-only: global-map-sample.html, PHP: global-map-sample.php, Template: wxglobal.php) and upload all files from your to your weather website (preserving the directory structure).

In the PHP versions, if you see words like

Note: this file (name-of-file-here) has not been downloaded by script-name.php yet. Check permissions on the file to allow write all (666)

appearing, it simply means you need to set permissions on the named file so it is writable by PHP .. generally permissions of 666 will work.


Download Updated
HTML-only .ZIP 16 Jan 2017 04:41pm PST (17 Jan 2017 00:41 GMT)
PHP version .ZIP 16 Jan 2017 04:41pm PST (17 Jan 2017 00:41 GMT)
Saratoga AJAX/PHP template
(USA, Canada, World) .ZIP
(V2 or V3 templates)
16 Jan 2017 04:41pm PST (17 Jan 2017 00:41 GMT)

Version history

  • Version 2.02 - 16-Jan-2017 - added fix for https Station URLs
  • Version 2.01 - 05-Jul-2016 - added support for required Google Map Browser JavaScript API key
  • Version 2.00 - 27-Nov-2013 - Rewritten for Google Maps API V3 and added selectable units controls for display.
  • Version 1.01 - 17-Nov-2013 - Google deprecated V2 of the Maps API so this script became non-operational. Replacement using V3 API underway.
  • Version 1.01 - 20-Jul-2010 - (html, php, template, template-ML) added ability to have links generated with target="_blank" and control for directory usage for cache files.
  • Version 1.00 - 17-Jul-2010 - Initial Release