cloudy cloudy

Author Topic: Alternative ATOM Feed Alert Program  (Read 62302 times)

0 Members and 1 Guest are viewing this topic.

curly

  • Guest
Alternative ATOM Feed Alert Program
« on: July 18, 2009, 03:48:17 AM »
An "all-in-one" program is available to display top warnings and full details from the ATOM feed provided by the National Weather Service.

It is designed to handle several NOAA zones at a time and can be used with or without the Carter Lake template set.
Two sets of usable web pages are included along with a demo page, detailed instruction and a set of 72 icons.
Main features include top warnings, top warning icons, alert box and an XML page. Each alert type is color coded to its severity and has a small icon so it can be easily distinguished when there are several alerts for each zone. All alerts from NOAA's NWS ATOM/XML are accepted when available.

The script uses code borrowed (with permission) from Mike Challis to fetch the data and Michael (mth) of Relay Weather contributed some code, features and did extensive beta testing.
Because of the amount of zones that the script can handle, a cron job must be used to call the script. If your web host doesn't offer the ability to do crons, information in the read me file will guide you on how this can be done in a proven and reliable method. A "pseudo-cron" does not work and is not supported. PHP 5 is required.

I have the demo page here AtomDemo
Relay weather has this running on his web site  Relay Weather

Download everything here  AtomAlerts.zip

* EDITED - This download reflects a new version that replaces this original version.

Curly
« Last Edit: December 17, 2009, 05:11:16 PM by curly »

Offline MCHALLIS

  • Posts: 2,145
  • Long Beach, WA USA
    • Weather for Long Beach, WA USA
Re: Alternative ATOM Feed Alert Program
« Reply #1 on: July 18, 2009, 06:57:49 AM »
Looks nice.  :D
I can tell you spent a lot of time programming that.

Code: [Select]
<?php
include("AtomArray.php");
$error '';
if (isset(
$_REQUEST['zone']) && preg_match("/^[A-Z]{2}Z[0-9]{3}$/i"$_REQUEST['zone'])) {
$A_Zone $_REQUEST['zone']; // valid zone syntax from input
$zone_error true;
}
else {
$zone_error false;
$error 'Invalid zone or no zone entered in URL';
}
?>

I would use GET instead of REQUEST when you are importing variables from a URL.

mth

  • Guest
Re: Alternative ATOM Feed Alert Program
« Reply #2 on: July 18, 2009, 12:40:40 PM »
All,

I wanted to display a few things that can be done with this script.  I've set up some temporary zones that currently have some advisories.

Check out the top warning box here (the icons give it a nice touch):
http://www.relayweather.com/

Check out the summary page which allows you to view all zones you have entered in the script:
http://www.relayweather.com/AtomSummary.php

Check out the detail of each zone:
http://www.relayweather.com/AtomZone.php?zone=AZZ002&loc=Lake Havasu, Fort Mohave  Arizona#WL


This is very easy to get going, supports the new NWS ATOM format and looks very nice.  Thanks to Curly for a great job!! :) :)

Michael

curly

  • Guest
Re: Alternative ATOM Feed Alert Program
« Reply #3 on: July 18, 2009, 01:39:57 PM »
Thanks Mike & Michael!

Made the change to $_GET in the AtomZone.php file.
Also changed the AtomFeed.php file putenv for the time zone to date_default_timezone_set.


Offline MCHALLIS

  • Posts: 2,145
  • Long Beach, WA USA
    • Weather for Long Beach, WA USA
Re: Alternative ATOM Feed Alert Program
« Reply #4 on: July 18, 2009, 03:29:57 PM »
I see another issue.

on this page, you have URL links with spaces. They should be urlencoded so the spaces are changed to %20, or a plus (+)
http://www.weather.ricksturf.com/AtomDemo.php

http://us3.php.net/urlencode

Offline wxflint

  • Posts: 140
  • When The Weather Gets Tough! Get With The Weather
  • Flint, Michigan
    • Flint, Michigan Live and Local weather
Re: Alternative ATOM Feed Alert Program
« Reply #5 on: July 18, 2009, 04:15:35 PM »
Im getting an error:
Warning: include(AtomArray.php) [function.include]: failed to open stream: No such file or directory
I didn't see the (AtomArray.php) included in the zip file

Live Local Weather http://wxflint.com

Offline ALITTLEweird1

  • Mark
  • Global Moderator
  • Posts: 4,931
  • North Bend, WA
    • North Bend Weather
Re: Alternative ATOM Feed Alert Program
« Reply #6 on: July 18, 2009, 04:22:50 PM »
Im getting an error:
Warning: include(AtomArray.php) [function.include]: failed to open stream: No such file or directory
I didn't see the (AtomArray.php) included in the zip file

Same Here...No File.
"Nature can do without man, but man cannot do without nature."

Davis VP2 + VP2 Solar + Logitech Webcam

warwickpaweather

  • Guest
Re: Alternative ATOM Feed Alert Program
« Reply #7 on: July 18, 2009, 04:32:37 PM »
Yeah here neither...

mth

  • Guest
Re: Alternative ATOM Feed Alert Program
« Reply #8 on: July 18, 2009, 04:51:26 PM »
Try running the AtomFeed.php file manually, you will then see three (3) files get created.  AtomWork.php, AtomCache.php and AtomArray.php.

These three files are the files that are created and updated when you run the script AtomFeed.php

Offline ALITTLEweird1

  • Mark
  • Global Moderator
  • Posts: 4,931
  • North Bend, WA
    • North Bend Weather
Re: Alternative ATOM Feed Alert Program
« Reply #9 on: July 18, 2009, 05:04:18 PM »
"Nature can do without man, but man cannot do without nature."

Davis VP2 + VP2 Solar + Logitech Webcam

mth

  • Guest
Re: Alternative ATOM Feed Alert Program
« Reply #10 on: July 18, 2009, 05:16:33 PM »
didnt work here...

http://www.snoqualmieweather.com/AtomFeed.php

Hang tight....I'm sure Curly will have this resolved very shortly.  :)

Offline MCHALLIS

  • Posts: 2,145
  • Long Beach, WA USA
    • Weather for Long Beach, WA USA
Re: Alternative ATOM Feed Alert Program
« Reply #11 on: July 18, 2009, 05:18:49 PM »
didnt work here...

http://www.snoqualmieweather.com/AtomFeed.php

Mark, your server does not have permission to create files.
I logged in and CHMOD your "web" folder to 777, ran AtomFeed.php and it created the files, then I CHMOD the "web" folder back to 715.

Offline wxflint

  • Posts: 140
  • When The Weather Gets Tough! Get With The Weather
  • Flint, Michigan
    • Flint, Michigan Live and Local weather
Re: Alternative ATOM Feed Alert Program
« Reply #12 on: July 18, 2009, 05:20:13 PM »
Working fine here Thanks :lol:

Live Local Weather http://wxflint.com

Offline ALITTLEweird1

  • Mark
  • Global Moderator
  • Posts: 4,931
  • North Bend, WA
    • North Bend Weather
Re: Alternative ATOM Feed Alert Program
« Reply #13 on: July 18, 2009, 05:21:10 PM »
Mark, your server does not have permission to create files.
I logged in and CHMOD your "web" folder to 777, ran AtomFeed.php and it created the files, then I CHMOD the "web" folder back to 715.


 #-o  LOL...Thanks again Mike. I see its working.
"Nature can do without man, but man cannot do without nature."

Davis VP2 + VP2 Solar + Logitech Webcam

curly

  • Guest
Re: Alternative ATOM Feed Alert Program
« Reply #14 on: July 18, 2009, 05:26:48 PM »
OK  Back again...

Fixed the blank spaces in the URL.
Instead of downloading the zip file, copy the code here  http://www.weather.ricksturf.com/scripts/AtomFeed.php?sce=view


As a side note, if you have a problem with the script or web page, please post a link.

Thanks
Curly



« Last Edit: July 18, 2009, 05:41:24 PM by curly »

 

cumulus