rss-advisory.php

Trying, as always, to get a script to work. This one is the rss-advisory.php. I changed the time to ‘America/Chicago’(CDT) and entered my NWS zone OKZ046.
I had to upload a ‘rss-advisory-OKZ046.txt’ file to my site. The only way I can get a refresh is [s]http://www.ardmoreweatherlive.com/rss-advisory.php?cache=refresh[/s] and set permissions to 777 on the text file which I understand is not a good idea. Also the time is -4hrs. I know its something I missed or entered incorrectly. My setting are below below.

Thanks again for the help, Doug.

##############
# begin settings -------------------------------------------------
##############
*/
//  change $myDefaultZone default(below) to your stations county zone
//  other settings are outlined below, and are optional

$myDefaultZone = 'OKZ046'; // <== change this to your zone

$hurlURL = 'test7.php'; // <== change this default to your webpage
                                 // to open for details

$HD = 'h2';  // <== type of heading for advisories <$HD>...</$HD>

$doLowerCase = false;  // <== change to true to lowercase the advisories (new in 1.05)

    // cacheName is name of file used to store cached current conditions
$cacheName = 'rss-advisory.txt';  // used to store the file so we
    //                                        don't have to fetch it each time
    // note: the real cache name will automatically be the above name with the Zone included
    //   ie:  rss-advisory.txt => rss-advisory-CAZ513.txt

$ourTZ = 'America/Chicago';  //NOTE: this *MUST* be set correctly to
   // translate UTC times to your LOCAL time for the displays.
   //  http://saratoga-weather.org/timezone.txt  has the list of timezone names
   //  pick the one that is closest to your location and put in $ourTZ like:
   //    $ourTZ = 'America/Los_Angeles';  // or
   //    $ourTZ = 'Europe/Brussels';
   // also available is the list of country codes (helpful to pick your zone
   // from the timezone.txt table
   //  http://saratoga-weather.org/country-codes.txt : list of country codes

//$timeFormat = 'D, Y-m-d H:i:s T';  // Fri, 2006-03-31 14:03:22 TZone
$timeFormat = 'D, d-M-Y h:ia T';  //  Sun, 27-Jan-2008 06:14am TZone

$refetchSeconds = 600; // refetch every nnnn seconds (600=10 minutes)

$flyer = false;  // <== change to true when using for a printable flyer page (new in 1.06)
                // when used for a printable flyer, advisory titles are shown without URL links

   //flyerpromo will show on your printable flyer page just after an advisory headline
   // example: High Wind Warning - South Washington Coast (Washington)(view at www.642weather.com)
$flyerpromo = '<span style="font-size: 11px;"> (view at www.642weather.com)</span>';

##############
# end of settings

The script does use a cache file named rss-advisory-[ZONE].txt and that text file needs to be writable by PHP … usually 664 or 666 permissions should do.

However, the NWS will discontinue the RSS feeds sometime soon in favor of the new ATOM/CAP feeds, so you should consider replacing your rss-advisory.php script with atom-advisory.php which reads the new feeds. It does require PHP5+ for operation.

Best regards,
Ken

Thanks Ken, got the script to work!
Wonder why my time is off? When you do a cache refresh I’m off 4hrs, I’m in CDT.
[s]http://www.ardmoreweatherlive.com/rss-advisory.php?cache=refresh[/s]
I’ll get this one working then tackle the atomphp.

Thanks, Doug

Edit: Looks like I have the atom-advisory.php script up. Thanks for the advice, Doug
http://www.ardmoreweatherlive.com/index.php