deformed-offering

Weather station scripts - weather radio player

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, 02-Aug-2017 10:12 PM

PHP Scripts (run on webserver)

NOAA/EC All Hazards Radio stream player

 

Both NOAA/NWS and Environment Canada operate many radio transmitters that carry NWS/EC weather and alert information. For many years, the WeatherUnderground website offered a place for weather enthusiasts to stream their local weather radio audio and for others to listen to the streaming audio on their systems. In January, 2017, WeatherUnderground stopped supporting that service, so a small band of enthusiastic volunteers created a new home for those streams at http://noaaweatherradio.org/ as a non-commercial public service. You can follow the story of the creation of noaaweatherradio.org at WXforum.net here and here. My particular thanks go to Mike at Frankfort/Twin Hollies Weather for his continuing work to host, create, and populate the streams for noaaweatherradio.org and to Chris of CrushedBox Software for hosting the stream server.

If you are interested in providing a stream of a NOAA/EC weather radio in your area, please see noaaweatherradio.org website "How To?" page for details to submit an audio stream.

The radios.php script (and the wxradio.php script for the Saratoga template) use the noaaweatherradio.org website data to show a page with the currently available radio streams, and allow the browser's audio player to play them. The scripts use HTML5/JavaScript/CSS with PHP to provide the small amount of customization required. The screen formatting uses jQuery and Bootstrap which is dynamically included in the page.

The original HTML5/JavaScript player page was created by Doug at Chappellweather.com. Mods were made to that script by Bob at Clifton Virginia Weather, Jerry at SE Lincoln Weather and John at Echo Valley Weather. The modifications to use noaaweatherradio.org data to generate the page/map and the packaging was done by Saratoga-weather.org.

The script uses a JavaScript/JSON file maintained on noaaweatherradio.org. To minimize the loading on that site, the NWR-radio-data.php program will fetch and cache locally the needed file and refresh it every hour as need be. The required images are included in the distribution .zip files.

Note: You need a Google Browser JavaScript API KEY to run this script
Generate the key from the Google Console: https://developers.google.com/maps/documentation/javascript/get-api-key
then change radios.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-';

Sample output

  NOAA/EC All Hazards Radio

Select Weather Radio Station Below

Station:
Frequency:
Transmitter location:
Stream Provided By:

Radio transmission courtesy of NOAA or Environment Canada.

This Audio Stream Player is not to be used for protection of life or property. Please see below for more details.
These audio streams are graciously provided by personal weather website owners and others though NOAAWEATHERRADIO.org.

Loading Map

LOADING DATA - PLEASE STANDBY

This Audio Stream Player is not to be used for protection of life or property. Please remember that you should NOT rely on this Internet audio to receive watches or warnings. Instead, you should have your own dedicated NOAA or Environment Canada Weather Radio receiver which will alert you 24 hours a day to hazards in your area. This stream player is provided as a convenience and is not an authoritative source for official watches, warnings or advisories -- those should be obtained directly using your own NOAA or EC Weather Radio receiver. Please do not rely on this page as your only source to hear NOAA/EC radio. When you need it most, storms may cause power outages at this end. It is a good idea to mainly rely on a separate NOAA/EC radio with battery back-up.

Note: Due to streaming software delays, this audio may be behind the NOAA/EC radio broadcast.

If you are interested in providing a stream for a NOAA/EC weather radio in your area, please see noaaweatherradio.org website "How To?" page for details to submit an audio stream.

Stream data last updated:

The NOAA/EC Radio player script set was developed by:
Chappelleweather.com with mods by Clifton Virginia Weather, SE Lincoln Weather, and Saratoga-weather.org

Configuration

############################################################################
# wxradio settings
# note: you can also use the following in Settings.php to override the below settings:
/*

$SITE['WXRstartup'] = 'KEC49';   // override $startup in wxradio.php
$SITE['WXRprovider'] = true;     // override $streamprovider in wxradio.php
$SITE['WXRmaptype'] = 'terrain'; // override $mapType in wxradio.php
$SITE['WXRautoplay'] = true;     // override $autoplaystartup in wxradio.php
$SITE['WXRbackground'] = 'lavenderblush'; // override $backgroundColor in wxradio.php
// see https://www.w3schools.com/cssref/css_colors.asp for color names

$SITE['googleAPI'] = '-your-Google-Map-API-key-here'; // key used for all Google Maps on site

*/
############################################################################
#
$startup = 'KEC49'; // Radio for first display, if 'alternate' include the -[char] in the name
//                     like 'KEC49-A'.  That value is displayed on the page after Station:
//                     when the station is selected in the dropdown list.
// Note that specific stream calls for alternate streams may change so it's best to use a
//   different search (such as the below) to select a specific stream for initial display.
//
//You can also use the City, provider name or website name to match.
// $startup = 'Monterey Marine';
// $startup = 'saratoga-weather.org';
// $startup = 'mikev';
$streamprovider = false; // =true if you provide a stream, =false if you don't provide a stream
//
$googleAPI = '-your-Google-Map-API-key-here-'; // your Google Maps API key
// note: A Settings.php entry of $SITE['googleAPI'] will override this entry.
//
$mapType   = 'terrain';  // ='roadmap', ='terrain', ='satellite', ='hybrid' for Google Map
#
$autoplaystartup = true; // =true; start audio when page loads, =false; no autoplay on page load
#
$backgroundColor = 'lavenderblush'; // CSS color name or #rrggbb hex format style for overall player
# see https://www.w3schools.com/cssref/css_colors.asp for color names and hex codes
#
############################################################################

For Saratoga template users, you normally do not have to customize the wxradio.php script itself as the most common configurable settings are maintained in your Settings.php file. This allows you to just replace the files on your site when new versions are released.

$SITE['WXRstartup'] = 'KEC49';
This setting controls the $startup search string to find the selected radio stream when the page first loads.
It can be the radio callsign or if it is an 'alternate' stream, include the -[char] in the name like 'KEC49-A'. That value is displayed on the page after Station: when the station is selected in the dropdown list.
Note that specific stream calls for alternate streams may change so it's best to use a different search (such as the below) to select a specific stream for initial display. You can also use the City, provider name or website name to match. like
'Monterey Marine', 'saratoga-weather.org', or 'mikev'
$SITE['WXRprovider'] = true;
This setting adds text to the page regarding your site providing one or more streams:
=true; - your site provides one or more NWR/EC streams
=false; - your site does not provide any NWR/EC radio streams.
$SITE['WXRmaptype'] = 'terrain';
This setting controls the Google map type. Select a type from:
='terrain';
='satellite';
='hybrid';
$SITE['WXRautoplay'] = true;
This setting controls the behavior of the player when the page is first loaded.
=true; - start playing the audio from the selected stream when the page loads
=false; - play the audio after manual click on 'play' button in player when the page first loads
$SITE['WXRbackground'] = 'lavenderblush';
This setting sets the CSS background color of the player content page. You can use either a CSS color name or a #rrggbb hex CSS color for the value. See the list of available CSS color names at w3schools.
$SITE['googleAPI'] = '-your-Google-Map-API-key-here';
This setting specifies the Google Map JavaScript API key for the Google map on the page. This setting is also used by other scripts: wxquake.php (quake-json.php), wxmesonetmap.php (mesonet-map.php) and wxglobal.php (global-map.php).
To obtain a key, visit https://developers.google.com/maps/documentation/javascript/get-api-key

Downloads

NOAA/EC Radio stream player [V1.05 -02-Aug-2017] :
Download for Saratoga Template
Download for Standalone use

Version history

  • Version 1.05 - 02-Aug-2017 - updated NWR-radios-data.php V1.01 to use header text/javascript to fix 'nosniff' issue with some websites
  • Version 1.04 - 05-Jul-2017 - corrected attribution (thanks Doug of Chappellweather.com !), added backgroundcolor setting, made all script settings available in Saratoga template Settings.php entries.
  • Version 1.03 - 02-Jul-2017 - added ./ajax-images/ for Inactive, Disabled and Marginal Quality stream indicators
  • Version 1.02 - 01-Jul-2017 - added ./ajax-images/NWR150MARQ.png for Marginal Quality feed indicator
  • Version 1.01 - 29-Jun-2017 - added local bootstrap.3.3.7-mod.min.css to fix wxradio.php Black template issue (gwwilk) and autoplaystartup setting for page-load behavior
  • Version 1.00 - 28-Jun-2017 - Initial release

 

deformed-offering