cloudy cloudy

Author Topic: NEW AtomFeed.php Program  (Read 62038 times)

0 Members and 1 Guest are viewing this topic.

curly

  • Guest
NEW AtomFeed.php Program
« on: December 17, 2009, 05:26:07 PM »
A NEW AtomFeed.php program is available.

This new version replaces the previous version.
Recommendations by forum members, changes at the NWS, and issues over the past several months are addressed in this revised program.

The AtomFeed program now consists of three files that makes it more efficient in downloading data, handling errors, and using county codes along with zone codes.

What's new…
  • Downloading alert data is more efficient.
  • Connection type of errors will not disrupt information on web pages.
  • Use of county codes and zone codes are combined without duplicating data.
  • Caching all data.
  • Alert Box can be configured in many ways.
  • Enhanced web pages.
  • A priority zone can be utilized.
  • A status page is produced.
  • All settings are in one configuration file.
  • Display archived alerts.

Requirements…
  • PHP 5.1 or newer.
  • A sub folder for the new AtomFeed files with permissions to create and delete files.
  • A program to run the script at regular intervals like a cron job or the Windows Task Scheduler.

This new AtomFeed program now operates in a sub folder and runs differently than before. Some of the default settings have changed and are noted in the ATOMread_me.html file that is included in the package.
The ‘top warnings’ box was replaced by the Alert Box and instructions on how to use it is also in the read me file.
Please take the time to read the instructions before switching over to this new version to ensure a smooth transition.

Download AtomFeed.php package version 4.91




Curly


« Last Edit: July 21, 2010, 11:17:40 PM by curly »

Offline ALITTLEweird1

  • Mark
  • Global Moderator
  • Posts: 5,145
  • North Bend, WA
    • North Bend Weather
Re: NEW AtomFeed.php Program
« Reply #1 on: December 17, 2009, 05:34:38 PM »
wow... Thanks for taking the time in making this Curly. I'll be adding this after work today.
"Nature can do without man, but man cannot do without nature."

Davis VP2 + VP2 Solar + VP2 UV + Lightning Detector + Logitech Webcam

Offline CNYWeather

  • Professional Trophymaker!
  • Posts: 1,521
  • Rome, New York
    • CNYWeather.com
Re: NEW AtomFeed.php Program
« Reply #2 on: December 17, 2009, 08:22:15 PM »
::Two Thumbs Up::

Thanks for the hard work on it Curly!
Tony

CNYWeather.com
CWOP: CW2352
WeatherUnderground: KNYWESTM1


http://www.CNYWeather.com

I Make Trophies Too!
http://www.speedyawards.com

curly

  • Guest
Re: NEW AtomFeed.php Program
« Reply #3 on: December 17, 2009, 11:05:18 PM »
Thanks for testing this on your end Tony!


As a side note, since this is going into another folder, do not delete the old AtomFeed.php file in your main folder until you test out the new one. You can always revert back to the old one if there are any issues.
« Last Edit: December 17, 2009, 11:08:33 PM by curly »

Offline CNYWeather

  • Professional Trophymaker!
  • Posts: 1,521
  • Rome, New York
    • CNYWeather.com
Re: NEW AtomFeed.php Program
« Reply #4 on: December 17, 2009, 11:54:18 PM »
Any time Rick! Always a pleasure to try and learn new stuff  :lol:


Got it up and running. Looks great!

Thanks Again
« Last Edit: December 18, 2009, 01:07:20 AM by cnyweather »
Tony

CNYWeather.com
CWOP: CW2352
WeatherUnderground: KNYWESTM1


http://www.CNYWeather.com

I Make Trophies Too!
http://www.speedyawards.com

Offline ALITTLEweird1

  • Mark
  • Global Moderator
  • Posts: 5,145
  • North Bend, WA
    • North Bend Weather
Re: NEW AtomFeed.php Program
« Reply #5 on: December 18, 2009, 01:39:53 AM »
I got it working, Thank you again Curly for all of your hard work.

One question... in the atomfeed-config file i have this for now..

Code: [Select]

"WAZ505" => "Snoqualmie,Wa", // Snoqualmie Wa - priority zone listed first
    "WAC033" => array(1 => "WAC033",'a' => "WAZ505"),  // COUNTY CODE => COUNTY CODE => ZONE CODE
    "WAZ033" => array(1 => "WAC033",'a' => "WAZ505",'b' => "WAZ505"),  // COUNTY CODE =>  COUNTY CODE => ZONE CODE => ZONE CODE
    "MDZ006" => "No.Balt.Co.", // N Baltimore
    "MDZ011" => "So.Balt.Co." // S Baltimore


In the old one i have this..

Code: [Select]

$ZoneLocation = array(
    "WAZ505" => "East Puget Sound Lowlands, WA ",
    "WAZ007" => "Seattle Metropolitan Area, WA ",
    "WAZ507" => "Everett, Vicinity, WA ",
    "WAZ509" => "Tacoma Area, WA ",
    "WAZ519" => "West Slopes Central Cascades and Passes, WA ",
    "WAC033" => "King County, WA",
    "WAC061" => "Snohomish County, WA",
    "WAC037" => "Kittitas County, WA",
    "WAC053" => "Pierce County, WA"



My main zone is WAZ505 and my main county is WAC033.. How would i type this into the new one? Thanks.
"Nature can do without man, but man cannot do without nature."

Davis VP2 + VP2 Solar + VP2 UV + Lightning Detector + Logitech Webcam

Offline CNYWeather

  • Professional Trophymaker!
  • Posts: 1,521
  • Rome, New York
    • CNYWeather.com
Re: NEW AtomFeed.php Program
« Reply #6 on: December 18, 2009, 01:52:30 AM »
I did mine like this if this helps you out:

Code: [Select]
// county/zone codes => location
$Code_Location = array(
"NYZ037" => "So Oneida Co.", // S ONEIDA - priority zone listed first
"NYZ009" => "No Oneida Co.", // N ONEIDA
"NYC065" => array(1 => "NYC065",'a' => "NYZ009", 'b' => "NYZ037"),  // array = county 2 zone conversion
"NYZ032" => "No Herkimer Co.", // N HERKIMER
"NYZ038" => "So Herkimer Co.", // S HERKIMER
"NYZ036" => "Madison Co.", // MADISON
"NYZ008" => "Lewis Co.", // LEWIS
"NYZ046" => "Otsego Co.", // OTSEGO
"NYZ006" => "Oswego Co.", // OSWEGO
Tony

CNYWeather.com
CWOP: CW2352
WeatherUnderground: KNYWESTM1


http://www.CNYWeather.com

I Make Trophies Too!
http://www.speedyawards.com

Offline ALITTLEweird1

  • Mark
  • Global Moderator
  • Posts: 5,145
  • North Bend, WA
    • North Bend Weather
Re: NEW AtomFeed.php Program
« Reply #7 on: December 18, 2009, 01:55:33 AM »
Thanks Tony, that does help. What are your main zone and county codes?
"Nature can do without man, but man cannot do without nature."

Davis VP2 + VP2 Solar + VP2 UV + Lightning Detector + Logitech Webcam

mth

  • Guest
Re: NEW AtomFeed.php Program
« Reply #8 on: December 18, 2009, 03:25:38 AM »
Curly,

Very nice job!!  :hello1: :hello1: :hello1:

Got it all up and running!

Michael

curly

  • Guest
Re: NEW AtomFeed.php Program
« Reply #9 on: December 18, 2009, 03:29:46 AM »
That extra array is for the county code to zone code conversion.
When entering a county code for the conversion, one zone code gets entered in the array ('a') unless that county is split into two zones. Only when a county is split into two zones, the second zone goes in 'b'.

This line is correct
Code: [Select]
   "WAC033" => array(1 => "WAC033",'a' => "WAZ505"),  // COUNTY CODE => COUNTY CODE => ZONE CODE

You will need to delete this line
Code: [Select]
   "WAZ033" => array(1 => "WAC033",'a' => "WAZ505",'b' => "WAZ505"),  // COUNTY CODE =>  COUNTY CODE => ZONE CODE => ZONE CODE

When you have an array like this, set  $use_conversion  to true.
If you do not have that type of an array, set  $use_conversion  to false.

Offline ALITTLEweird1

  • Mark
  • Global Moderator
  • Posts: 5,145
  • North Bend, WA
    • North Bend Weather
Re: NEW AtomFeed.php Program
« Reply #10 on: December 18, 2009, 03:45:22 AM »
Thanks Curly... Got a couple more questions...lol

The warning showing now on my index page isnt one of my main county or zone codes but its still showing.

$local_alerts = true;  // true=show primary location

Unless im misunderstanding that, it should only show my current zone or county code alerts, is that correct?

The alert box isnt centered below the "weather alerts". Ive tried changing the box size, but that didnt seem to do much to align it. Fixed
« Last Edit: December 18, 2009, 03:48:17 AM by ALITTLEweird1 »
"Nature can do without man, but man cannot do without nature."

Davis VP2 + VP2 Solar + VP2 UV + Lightning Detector + Logitech Webcam

curly

  • Guest
Re: NEW AtomFeed.php Program
« Reply #11 on: December 18, 2009, 04:32:15 AM »
Is your zone the first one listed in the array?

Offline rrrick8

  • Posts: 359
  • Danville, Illinois
    • Vermilion County Weather
Re: NEW AtomFeed.php Program
« Reply #12 on: December 18, 2009, 04:32:30 AM »
Thanks Curly.
Got it downloaded and will install and test it tomorrow.
----------------------
Rick
EMA Severe Weather Manager
CWOP-CW9931 -  KILDANVI5

Offline ALITTLEweird1

  • Mark
  • Global Moderator
  • Posts: 5,145
  • North Bend, WA
    • North Bend Weather
Re: NEW AtomFeed.php Program
« Reply #13 on: December 18, 2009, 04:35:39 AM »
Is your zone the first one listed in the array?

This is what i have...WAZ505 is my primary zone and WAC033 is my primary county. I got the other warning not showing now, which is what i wanted. is there a way for it to show " no warnings/advisories for a zone/location"? if there are no warnings?

Code: [Select]

$Code_Location = array(
    "WAZ505" => "Snoqualmie,Wa", // Snoqualmie Wa - priority zone listed first
    "WAC033" => array(1 => "WAC033",'a' => "WAZ505"),  // COUNTY CODE => COUNTY CODE => ZONE CODE
    "WAZ508" => "Seattle Metropolitan Area, WA", // Seattle
    "WAZ509" => "Tacoma Area, WA", // Tacoma
    "WAZ519" => "West Slopes Central Cascades and Passes, WA", //
    "WAC061" => "Snohomish County, WA", // Snohomish County, WA
    "WAC037" => "Kittitas County, WA", // Kittitas County, WA
    "WAC053" => "Pierce County, WA" // Pierce County, WA

"Nature can do without man, but man cannot do without nature."

Davis VP2 + VP2 Solar + VP2 UV + Lightning Detector + Logitech Webcam

curly

  • Guest
Re: NEW AtomFeed.php Program
« Reply #14 on: December 18, 2009, 04:52:40 AM »
Yes it should be showing a non alert message in the box.

I will need to duplicate your settings and see what is going on.
The problem that I have now is my internet service is down so I can't get your county and zone alerts.  #-o