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.
A RSS Feed is available to help keep you informed on updates to the scripts.
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
Tuesday, 01-Sep-2009 2:15 PM
PHP for NWS Area Forecast Discussion
This PHP script will fetch and cache the Forecast Area Discussion issued by your local NWS office.
Thanks to Mike Challis of Long Beach, WA for the inspiration for and enhancement of this script.
000
FXUS66 KMTR 111738
AFDMTR
AREA FORECAST DISCUSSION
NATIONAL WEATHER SERVICE SAN FRANCISCO BAY AREA CA
940 AM PST THU MAR 11 2010
.DISCUSSION...AS OF 9:20 AM PST THURSDAY...CLEAR SKIES ARE BEING
REPORTED ACROSS THE AREA THIS MORNING. UNDER CLEAR SKIES AND
NORTHWEST FLOW TEMPERATURES FELL INTO THE MID 30S INLAND AND
HOVERED IN THE LOW TO MID 40S ALONG THE COAST. HIGH PRESSURE WILL
KEEP BLUE SKIES OVER THE AREA TODAY. HOWEVER...THE LATEST VISIBLE
SATELLITE IMAGE IS SHOWING CLOUDS STREAMING OVER THE RIDGE ACROSS
NORTHERN CALIFORNIA.
MODEL SOLUTIONS HAVE INITIALIZED WELL WITH THE CYCLONIC CIRCULATION
CURRENTLY LOCATED APPROXIMATELY 46N AND 145W. MODELS SUGGEST THAT
THIS CIRCULATION WILL DRAG A COLD FRONT ACROSS THE CWA TOMORROW
EVENING. A CROSS SECTION WAS CARRIED OUT NORMAL TO THE THERMAL
WIND AND DID INDICATE SOME POTENTIAL INSTABILITY BETWEEN 850 AND
600 MB AHEAD OF SOME MODERATE LEVELS OF PETTERSON FRONTOGENESIS...
SUGGESTING ISOLATED CONVECTION. HOWEVER...NAM BUFR SOUNDINGS TAKEN
AROUND VARIOUS POINTS IN THE CWA DO INDICATE A FAIRLY STABLE
ENVIRONMENT...RULING OUT THUNDERSTORMS. SHOWERS TOMORROW EVENING
WILL BE CAPABLE OF PRODUCING MODERATE RAINFALL AT TIMES AND MAY
EVEN CONTAIN SOME SMALL HAIL. THE GREATEST AMOUNTS OF PRECIPITATING
WILL OCCUR OVER THE NORTHBAY MOUNTAINS AS THE FRONT PASSES BY.
ONCE THIS COLD FRONT PASSES HIGH PRESSURE WILL BUILD OVER THE
EASTERN PACIFIC PROVIDING DRY PLEASANT WEATHER FOR THE WEEKEND.
MODEL SOLUTIONS DEPICT THAT THE RIDGE OF HIGH PRESSURE WILL BUILD
TO 574DM OVER THE BAY AREA SUNDAY. THIS WILL RESULT IN HIGH
TEMPERATURES IN THE MID TO UPPER 60S ACROSS THE CWA AND POSSIBLY
LOW 70S IN SOUTHERN MONTEREY. THE CPC 6 TO 10 DAY OUTLOOK SUPPORTS
WARM TEMPERATURES AND DRY CONDITIONS FOR THE REMAINDER OF THE
FORECAST.
&&
.AVIATION...AS OF 9:40 AM PST THURSDAY...HIGH PRESSURE RIDGE WILL
KEEP VFR CONDITIONS THROUGH THE ENTIRE AREA TODAY WITH WIND SPEEDS
EXPECTED TO GENERALLY BE UNDER 12 KT. RAIN RETURNS AFTER 12Z FOR THE
NORTH BAY VALLEYS.
VICINITY OF KSFO...VFR ALL DAY WITH SPEEDS UNDER 12 KT EXPECTED.
RAIN RETURNS AFTER 16Z FRIDAY. HIGH CONFIDENCE.
KSFO BRIDGE APPROACH...SAME AS KSFO.
MRY BAY AREA TERMINALS...VFR THROUGH THE REMAINDER OF THE DAY WITH
WINDS UNDER 10 KT. HIGH CONFIDENCE.
PROPOSED RULE-MAKING...EFFECTIVE 15Z TUESDAY APRIL 6TH 2010 THE SAN
FRANCISCO BAY AREA OFFICE AT MONTEREY WILL BEGIN 3-HOURLY TAF
ISSUANCES FOR KSFO. THESE INTERMEDIATE TAFS AT 03Z...09Z...15Z...AND
21Z WILL BE ISSUED AS AMENDMENTS TO THE TAFS ISSUED AT 00Z...06Z...
12Z...AND 18Z. THE INTERMEDIATE TAFS WILL BE ISSUED DURING A 20-
MINUTE WINDOW BETWEEN 10 MINUTES BEFORE THE DESIGNATED ISSUANCE HOUR
AND 10 MINUTES AFTER THE HOUR. COMMENTS ON THIS PROPOSED RULE-MAKING
WILL BE ACCEPTED TO MARCH 19TH. COMMENTS CAN BE ADDRESSED TO THE
WEBMASTER AT THE NWS AT MONTEREY AT WWW.WEATHER.GOV/SANFRANCISCO.
&&
.MTR WATCHES/WARNINGS/ADVISORIES...
.TDA...ROUGH BAR FOR SF BAR.
&&
$$
PUBLIC FORECAST: LARRY
AVIATION/MARINE: BELL
NWS ON THE WEB AT WEATHER.GOV/SANFRANCISCO
NWS MTR Office Area Forecast Discussion
To use, include the output of the script on your webpage by either using
<?php include("http://your.website.com/forecast-discussion.php?inc=Y"); ?>
or by using
<?php $doIncludeFD = true; include("forecast-discussion.php"); ?>
to perform the include. Settings inside the script are:
// settings:
// change myNWS to abbreviation for your local NWS office
// other settings are optional
//
$myNWS = 'MTR'; // San Francisco, NWS office
// $myNWS = 'PQR'; // Portland, OR
// $myNWS = 'OAX'; // Omaha, NE (Carter Lake, IA)
//
$cacheName = "forecast-discussion.txt"; // used to store the file so we don't have to
// fetch it each time
$refetchSeconds = 1800; // refetch every nnnn seconds
// end of settings
The only required setting is for $myNWS which designates the local NWS office.
To find the 3-character abbreviation for your local NWS office for the $myNWS variable, follow these steps:
- Browse to www.weather.gov
- Use the search box on the left to search for your city, state
- Look at the URL in the 'Forecast Discussion' link near the bottom of the page
- Use the 3-character abbreviation is in the &issuedby=XXX parameter on the
Forecast Discussion link (XXX will be your local office)
- put the XXX in the $myNWS = 'XXX'; statement
The script has two optional parameters when you call it by URL from your website::
- inc=Y
- Will return the contents without the surrounding <html><head></head><body> and </body></html> tags
- cache=no
- Will override the default $refetchSeconds=1800 so that the cache is refreshed immediately
NWS Area Forecast Discussion PHP script Demo and Download (Version 1.02 - 30-Dec-2007 see history).