Shipping Forcast Parser
Parses the Shipping Forecast, and retrieves only a specific area. + optionally the header "Issued by the Met Office at ****.
WARNING NOT TO BE USED FOR NAVIGATION. this is a gimmick and no substitute for a Properly sourced forecast. it may expire if any of several servers expire. Use for interest only. Also actually using it on a public site may be illegal I can find no sign saying you may not republish the shipping Forecast, it used to be a public service that bitch Maggie( small m please take offense) probably privatized it. Am still annoyed about the unavailability of Brighton Tide Harmonics for the same reason!
Description
This is a PHP function that loads the shipping forecast from http://iwin.nws.noaa.gov retrieves the currently published forecast for the are supplied, with or with out the intro and issue time (Issued by the Met office at "time" "date"). In 3 formats HTML (just p and br tags), text (unix linefeed) or as a string (no linefeeds).
Parameter List
the forecast area you interested in in my case I put in "Dover". case insensitive (I hope).
Do you want the intro I strongly suggest you do, so you can tell its a current forecast that's being displayed. 0 (zero) for intro 1 for an intro
Format, stick in one of the following:
Return Values
Returns nice paragraph or string similar to:
THE SHIPPING FORECAST ISSUED BY THE MET OFFICE AT 1725 ON SATURDAY 05 FEBRUARY 2005
DOVER WIGHT PORTLAND SOUTH BACKING SOUTHEAST 3 OR 4, OCCASIONALLY 5. RAIN AT TIMES. MODERATE OR GOOD
Example 1. get_forecast() example
The above will output:
SHANNON ROCKALL MALIN HEBRIDES NORTH 6 TO GALE 8, VEERING NORTHEAST 4 OR 5, OCCASIONALLY 6, BUT SOUTH OR SOUTHEAST IN NORTH ROCKALL AND HEBRIDES. SHOWERS. MODERATE OR GOOD
CODE:
function