Author Topic: New Weather Alert Program  (Read 39708 times)

0 Members and 1 Guest are viewing this topic.

Offline Curly

  • Forecaster
  • *****
  • Posts: 724
    • Michiana Weather
New Weather Alert Program
« on: July 30, 2012, 07:58:04 AM »
A new weather alert program is available to get alerts for a specified county by using a Zone code and a County code.
Data is provided by the National Weather Service - Public Alerts which they update every two minutes.

KEY FEATURES
  • A cron job is not needed for a single location
  • Multiple codes can be used for a location
  • A Google map displays cloud cover and outlined alert areas (when provided)
  • Integrates with Saratoga Base-USA V3 template set


This program, NWS-alerts, is designed to fit into most web sites in the US and Puerto Rico using PHP version 5 or newer.
The complete package comes with detailed instructions in a read-me file, web pages for the summary and details, files, and icons.

If you are using the Saratoga Base-USA V3 template, you can update your files and get this program by using the PHP/AJAX Website Template Set - Updates page at Saratoga.org.
Or you can download the package at http://www.weather.ricksturf.com/scripts/nws-alerts.zip


Note: This is a replacement for the AtomFeed program. The main file is half the size, it's easier to configure locations, a few more options added, and downloads data faster. Sorry, but this new program does not have the ability to log alerts like the AtomFeed.
« Last Edit: July 30, 2012, 08:11:27 AM by Curly »

Offline Axelvold

  • Forecaster
  • *****
  • Posts: 1704
    • Axelvold's weather and photo
Re: New Weather Alert Program
« Reply #1 on: July 30, 2012, 08:08:56 AM »
The download link does not work.

http://www.weather.ricksturf.com/scripts/nwsalerts.zip just returns a 404 error.
Lars Magnusson
Axelvold / Sweden
55° 57' 41" N / 13° 6' 1" E
WX Station: Davis Vantage Pro2 Plus

Offline Curly

  • Forecaster
  • *****
  • Posts: 724
    • Michiana Weather
Re: New Weather Alert Program
« Reply #2 on: July 30, 2012, 08:12:33 AM »
Sorry about that    #-o
I forgot to put the dash in the file name.
It works now.
http://www.weather.ricksturf.com/scripts/nws-alerts.zip
« Last Edit: August 12, 2012, 08:43:16 PM by Curly »

Offline Axelvold

  • Forecaster
  • *****
  • Posts: 1704
    • Axelvold's weather and photo
Re: New Weather Alert Program
« Reply #3 on: July 30, 2012, 08:14:07 AM »
Sorry about that    #-o
It works now.

Jepp, it does.  =D>

Thank's Curly
Lars Magnusson
Axelvold / Sweden
55° 57' 41" N / 13° 6' 1" E
WX Station: Davis Vantage Pro2 Plus

Offline AWL

  • Forecaster
  • *****
  • Posts: 727
    • Ardmore Weather Live
Re: New Weather Alert Program
« Reply #4 on: July 30, 2012, 08:34:38 AM »
I have been running your old one for a long time now with no problems. Should I update or stay with your old one?

Thanks for the great scripts, Doug

Offline ed2kayak

  • Ed
  • Forecaster
  • *****
  • Posts: 613
  • Davis Vantage Pro2 w/12 hr FARS, solar/uv
    • Cumberland Valley Weather
Re: New Weather Alert Program
« Reply #5 on: July 30, 2012, 08:57:00 AM »
Up and running here.

http://cvweather.org/index.php

Kudos to Curly. =D>
Thank you to Ken, as well,  for integrating in template set.
« Last Edit: July 30, 2012, 09:07:02 AM by ed2kayak »
Ed
CoCoRaHS PA-CD-6,  Weather Underground KPAMECHA7, CWOP DW5425

Offline Curly

  • Forecaster
  • *****
  • Posts: 724
    • Michiana Weather
Re: New Weather Alert Program
« Reply #6 on: July 30, 2012, 09:28:46 AM »
I have been running your old one for a long time now with no problems. Should I update or stay with your old one?

"If it's not broke...."

The NWS-alerts is a smaller program and faster getting alerts for multiple locations.
If you have more than two locations in the AtomFeed and not using the Saratoga Base-USA V3 template kit, then you can keep what you have.
I do recommend the update if you are using Kens Base-USA V3 template kit, planning to update from version 2, or have one (or possibly two) alert locations.
« Last Edit: July 30, 2012, 09:32:10 AM by Curly »

Offline Curly

  • Forecaster
  • *****
  • Posts: 724
    • Michiana Weather
Re: New Weather Alert Program
« Reply #7 on: July 30, 2012, 10:21:49 AM »
Up and running here.

http://cvweather.org/index.php

Thanks Ed for beta testing this program and your input.

Also, thanks go out to others testing the script - Jerry, Jim, Ken, and Frank.

Offline Andy G

  • Forecaster
  • *****
  • Posts: 306
    • SunPrairieWeather.com
Re: New Weather Alert Program
« Reply #8 on: July 30, 2012, 12:02:59 PM »
Running Here http://www.sunprairieweather.com/

Thanks Curly and everyone else

I have two questions

1. can I add this to any page by following the procedure for the index page?

2. If i want to add more counties how would I set up the cron job I have done it before for other things  but am unsure what to "cron" maybe i missed it in the instructions.

Thanks again Andy
« Last Edit: July 30, 2012, 12:24:56 PM by Gootch »
Once you can accept the universe as being something expanding into an infinite nothing which is something, wearing stripes with plaid is easy.
~Einstein


SunPrairieWeather.com
Davis VP2 24 FARS

Offline gwwilk

  • Southeast Lincoln Weather
  • Forecaster
  • *****
  • Posts: 2578
    • SouthEast Lincoln, NE Weather
Re: New Weather Alert Program
« Reply #9 on: July 30, 2012, 12:23:24 PM »
Running Here http://www.sunprairieweather.com/

Thanks Curly and everyone else

I have two questions

1. can i add this to any page by following the procedure for the index page?

2. If i want to add more counties how would I set up the cron job I have done it before for other things  but am unsure what to "cron" maybe i missed it in the instructions.

Thanks again Andy

Curly's offline, but I can answer #2 above.  Windows System Scheduler, available free here, is the program you probably want.  I use it for a number of scheduling/CRON jobs on my site, including WXSIM.

I think you can add it to any page on your website, but I haven't done so.  Curly would be able to provide a definitive answer to that question.


« Last Edit: July 30, 2012, 12:24:58 PM by gwwilk »
Regards, Jerry Wilkins
gwwilk@gmail.com

Offline CNYWeather

  • Forecaster
  • *****
  • Posts: 2295
    • CNYWeather
Re: New Weather Alert Program
« Reply #10 on: July 30, 2012, 12:41:29 PM »
Looks like another project. Thanks to Curly and all the guys who tested it out.

Stupid Question probably, any way to get this to Tweet the alerts too like NWS-Alert-Messenger does?
That would be a huge addition but probably a lot of effort.
Tony




Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9257
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: New Weather Alert Program
« Reply #11 on: July 30, 2012, 12:41:54 PM »
Thanks to Curly for graciously allowing the new NWS-alerts system to be included in the Base-USA V3 template set!

For those using the updates tool page to get the new files,
use 28-Jul-2012 as the date for the Base-USA query .. that way, you'll get a complete set.

There is a README-Base-USA-changes-2012-07-28.txt file included that shows the additions to Settings.php, header.php, menubar.php needed if you choose to modify your existing files instead of porting your current mods to the new files.  It also includes a bit about setting up cron.   Curly's documentation is in the NWS-alerts_read_me.html file.

Best regards,
Ken
« Last Edit: July 30, 2012, 12:45:54 PM by saratogaWX »
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline Andy G

  • Forecaster
  • *****
  • Posts: 306
    • SunPrairieWeather.com
Re: New Weather Alert Program
« Reply #12 on: July 30, 2012, 12:55:22 PM »
Thanks for the info Ken I found the read me file will work on it.

Andy
Once you can accept the universe as being something expanding into an infinite nothing which is something, wearing stripes with plaid is easy.
~Einstein


SunPrairieWeather.com
Davis VP2 24 FARS

Offline Curly

  • Forecaster
  • *****
  • Posts: 724
    • Michiana Weather
Re: New Weather Alert Program
« Reply #13 on: July 30, 2012, 01:08:31 PM »
Stupid Question probably, any way to get this to Tweet the alerts too like NWS-Alert-Messenger does?
That would be a huge addition but probably a lot of effort.

Sorry Tony but I don't know what it would take to do that.

Offline CNYWeather

  • Forecaster
  • *****
  • Posts: 2295
    • CNYWeather
Re: New Weather Alert Program
« Reply #14 on: July 30, 2012, 01:25:37 PM »
No problem.  :-)
Tony




Offline Curly

  • Forecaster
  • *****
  • Posts: 724
    • Michiana Weather
Re: New Weather Alert Program
« Reply #15 on: July 30, 2012, 01:29:59 PM »
Running Here http://www.sunprairieweather.com/

Thanks Curly and everyone else

I have two questions

1. can I add this to any page by following the procedure for the index page?

Yes you can.

Quote
2. If i want to add more counties how would I set up the cron job I have done it before for other things  but am unsure what to "cron" maybe i missed it in the instructions.

In Kens update files, there are instructions on how to set up a real cron job.
I personally use the Windows Task Scheduler. A link is provided on how to use the Task Scheduler in the NWS-alerts_read_me file.
Either way you choose to do it, it has to call the nws-alerts.php file every xx amount of minutes to update the cache files.





Offline Andy G

  • Forecaster
  • *****
  • Posts: 306
    • SunPrairieWeather.com
Re: New Weather Alert Program
« Reply #16 on: July 30, 2012, 01:59:04 PM »
Sorry to ask such a basic question from you experts

If I use windows Task Scheduler will this work on my godaddy linux server or does it stay locally on my computer and "do its thing".

or if I have a linux server I must use a cron job?

Thanks Andy
Once you can accept the universe as being something expanding into an infinite nothing which is something, wearing stripes with plaid is easy.
~Einstein


SunPrairieWeather.com
Davis VP2 24 FARS

Offline Curly

  • Forecaster
  • *****
  • Posts: 724
    • Michiana Weather
Re: New Weather Alert Program
« Reply #17 on: July 30, 2012, 02:11:33 PM »
If I use windows Task Scheduler will this work on my godaddy linux server or does it stay locally on my computer and "do its thing".

or if I have a linux server I must use a cron job?

All of the NWS-alerts files are kept on the GoDaddy server and none are used on your computer.
If you want Windows Task Scheduler to call the new-alerts.php file, a small .vbs file is used on your computer.

I'm not familiar with GoDaddys Cpanel but it should be able to run a cron. GoDaddy should have documentation about setting up a cron job.

Offline gwwilk

  • Southeast Lincoln Weather
  • Forecaster
  • *****
  • Posts: 2578
    • SouthEast Lincoln, NE Weather
Re: New Weather Alert Program
« Reply #18 on: July 30, 2012, 02:14:19 PM »
I use GoDaddy, and I had already long since exceeded their meager CRON job allotment, so I went with Windows System Scheduler.  It's easy to configure and use once you get the hang of it.
Regards, Jerry Wilkins
gwwilk@gmail.com

Offline Andy G

  • Forecaster
  • *****
  • Posts: 306
    • SunPrairieWeather.com
Re: New Weather Alert Program
« Reply #19 on: July 30, 2012, 03:09:18 PM »
I must have set the godaddy cron job up correctly. I added brown county (currently under a watch) to my array as a test and it works! I will work on the windows scheduler later I'm off to work now.

Thanks Curly and everyone else for your replies.

Andy
Once you can accept the universe as being something expanding into an infinite nothing which is something, wearing stripes with plaid is easy.
~Einstein


SunPrairieWeather.com
Davis VP2 24 FARS

Offline Curly

  • Forecaster
  • *****
  • Posts: 724
    • Michiana Weather
Re: New Weather Alert Program
« Reply #20 on: July 30, 2012, 03:17:05 PM »
It's working like it should!

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9257
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: New Weather Alert Program
« Reply #21 on: July 30, 2012, 03:18:14 PM »
You won't need the windows scheduler if you have a working cron job .. no need to have the data fetched by two different methods.  Use the scheduler only if you have no cron jobs available.
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline n3ouc

  • Contributor
  • ***
  • Posts: 123
    • Air Products Campus Weather
Re: New Weather Alert Program
« Reply #22 on: July 30, 2012, 03:24:51 PM »
Hi Curly,
Thank you for this update and to Ken for the ease of incorporating it into the V3 templates. All is up and running on both sites and looking good!

Thanks Again,
Mike
Mike Stanton
Air Products Campus Weather

Offline user3162

  • Member
  • *
  • Posts: 40
Re: New Weather Alert Program
« Reply #23 on: July 30, 2012, 03:48:41 PM »
Script is very nice, thanks Curly! My question, I don't get much traffic, ~15 unique visitors a day. Would I not be better off to not use a cron or scheduler?

Offline Curly

  • Forecaster
  • *****
  • Posts: 724
    • Michiana Weather
Re: New Weather Alert Program
« Reply #24 on: July 30, 2012, 04:34:52 PM »
Script is very nice, thanks Curly! My question, I don't get much traffic, ~15 unique visitors a day. Would I not be better off to not use a cron or scheduler?

Glad you like it!

Setting up a cron job just speeds things up depending on the total codes you have in the array.
Each location should have at least 2 codes to check for alerts. If you have four locations, that would be a minimum of 8 codes.
Each code entered takes about 2 tenths of a second to check for alerts. If an alert is found, then the alert(s) are downloaded for that code and that takes about 2 tenths of a second per code.
Four tenths of a second doesn't seem that long for each code but that's when conditions are right. When conditions are not right, it could take two to four seconds per code just to check for alerts and then that amount for downloading the alert details. NOW the check and download times are starting to add up per code.

Without a cron, the index page visit makes the script download the data. For one location when conditions are not favorable, the index page wouldn't load for 8 seconds, but that is tolerable.
If you had 4 locations, that could be well over 30 seconds to wait for the page to load. I think that would discourage any visitor.

The purpose of a cron is to have the cache files already on hand so that the index page won't stall out waiting on the downloads if the internet conditions are bad.

In my opinion, if the total amount of codes in the array is four or less, then I would not use a cron. Anything over four should use a cron.



« Last Edit: July 30, 2012, 04:37:19 PM by Curly »

 

anything