cloudy cloudy

Author Topic: NWS Public Alert Messenger PHP Script  (Read 80266 times)

0 Members and 1 Guest are viewing this topic.

Offline wxflint

  • Posts: 140
  • When The Weather Gets Tough! Get With The Weather
  • Flint, Michigan
    • Flint, Michigan Live and Local weather
Re: NOAA Top Weather Advisory Alerter PHP Script
« Reply #15 on: July 10, 2009, 11:24:14 PM »
Great App.. Works like a charm Thanks Mike =D>

Live Local Weather http://wxflint.com

abaldish

  • Guest
Re: NOAA Top Weather Advisory Alerter PHP Script
« Reply #16 on: July 11, 2009, 01:56:01 AM »
Have mine all installed both of them. But had to put into a seperate directory and let the owner be the only one able to read write and execute the files. So now if i type in the directory name those files are in comes up 403 error also had to place a seperate copy of the rss-top-warning-2009 in there also. as it would not allow writing to the directory when pulling from another. So now waiting for the 15 mins to run and see if the cron runs it, have to wait 6 hours for the other.

Offline MCHALLIS

  • Posts: 2,158
  • Long Beach, WA USA
    • Weather for Long Beach, WA USA
Re: NOAA Top Weather Advisory Alerter PHP Script
« Reply #17 on: July 11, 2009, 02:02:38 AM »
My scripts run in the same directory on my server, no problem.
Some servers are setup to be very strict about file permissions.

Some users have file permissions problems with the cache files:
Here are some tips:
(Do this only if you are having file permissions errors!)
Create the file in Notepad or similar text editor. The file can be empty.
adv-alert-email-XXXXX.txt (substitute XXXXX for your NOAA zone code in UPPER CASE)
rss-advisory-XXXXX.txt
Upload it to your server and CHMOD it to 666
You may continue to have problems if your server has "safe_mode on" or other restrictions on file create, file write functions.
In that case, find out if you can use your own php.ini to change PHP settings.
Please consult your web host tech support, or perhaps get another less restrictive web host!
« Last Edit: July 11, 2009, 02:14:40 AM by MCHALLIS »

abaldish

  • Guest
Re: NOAA Top Weather Advisory Alerter PHP Script
« Reply #18 on: July 11, 2009, 04:50:48 AM »
nws-forecast-messenger & rss-weather-alerter work perfect with the way i had to set them, Just tested them now to make sure they where sending the data from the cron job. And sure enough the forecast was there and the weather alerter i had to set to test as there are none here now, and get my email on the phone for both.

Great job you guys do!

Offline CNYWeather

  • Professional Trophymaker!
  • Posts: 1,521
  • Rome, New York
    • CNYWeather.com
Re: NOAA Top Weather Advisory Alerter PHP Script
« Reply #19 on: July 11, 2009, 04:28:40 PM »
Dont see Special Weather Statements coming through to Advisory Alerter Mike.

I do see that in the beta feeds

http://www.weather.gov/alerts-beta/wwaatmget.php?x=NYZ037
« Last Edit: July 11, 2009, 04:33:21 PM by cnyweather »
Tony

CNYWeather.com
CWOP: CW2352
WeatherUnderground: KNYWESTM1


http://www.CNYWeather.com

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

Offline MCHALLIS

  • Posts: 2,158
  • Long Beach, WA USA
    • Weather for Long Beach, WA USA
Re: NOAA Top Weather Advisory Alerter PHP Script
« Reply #20 on: July 11, 2009, 05:25:07 PM »
Tony, I just loaded up the script with your zone and it worked.

If email is not sending, here is couple things to troubleshoot:
Correctly set the $email_address and $email_address_sent_from
By default, email is disabled. ( I guess I did this because you have to set your email address anyway and while there you should look at all the settings)
To enable email sending, set the change the setting $do_not_email = 1; to $do_not_email = 0;
The script will only send out an alert email one time when there is a change in alert status.

Hey everybody! What about this idea?
Currently, the script will only sends out an alert email one time when there is a change in alert status.
I might add a feature to resend the alerts every xx amount of hours.
This could be an option setting to turn on or off and set a time interval.

Sometimes in the winter I get a high wind warning that lasts for 3 days.
Using this proposed feature it could resend the alerts every 12 hours.

I use this feature ($flood_filter_enabled and $flood_filter_minutes) in my NWS Weather Forecast Messenger PHP Script
My cron actually calls that script every 15 minutes, but I set the $flood_filter_minutes to 355 minutes.
This allows the script to send a message approx every 6 hours. I think this feature would be great for this script also, I would set it to every 12 hours. also it would not send messages when there are no alerts.

Edit: Feature added in Version: 1.07 - 11-Jul-2009

« Last Edit: July 12, 2009, 12:20:07 AM by MCHALLIS »

Offline CNYWeather

  • Professional Trophymaker!
  • Posts: 1,521
  • Rome, New York
    • CNYWeather.com
Re: NOAA Top Weather Advisory Alerter PHP Script
« Reply #21 on: July 11, 2009, 05:38:45 PM »
I just had another special weather statement at 1:33pm issued Mike and it's a no show on FB or Twitter or email

http://www.cnyweather.com/rss-weather-alerter.php

Here's what I have.

Code: [Select]
// set to 1 to test the script's email function (it will send a test fake alert, be sure to set it back when done)
// set to 0 for normal operation
$test_email_advisory = 0;

// set to 1 to testing the script (will not send ANY emails!, be sure to set it back when done testing)
// set to 0 for normal operation
$do_not_email = 0;

// NOAA rss server where feeds come from
$RSS_URL = 'http://www.weather.gov/alerts-beta/wwaatmget.php?x=';
Tony

CNYWeather.com
CWOP: CW2352
WeatherUnderground: KNYWESTM1


http://www.CNYWeather.com

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

Offline MCHALLIS

  • Posts: 2,158
  • Long Beach, WA USA
    • Weather for Long Beach, WA USA
Re: NOAA Top Weather Advisory Alerter PHP Script
« Reply #22 on: July 11, 2009, 05:54:23 PM »
There can be many alerts at the same time, so it uses "Top Warning" code from my other script, it only recognizes the top most urgent warning.

Your current active top alert is "Severe Thunderstorm Watch"
No messages will be sent until the advisory status changes to something other than "Severe Thunderstorm Watch".
This has a limitation if the alert is active for more than a desired message sending interval. I just explained in my last post, i think I will add a feature to resend current alerts every xx hours. I like the idea of every 12 hours.

Offline CNYWeather

  • Professional Trophymaker!
  • Posts: 1,521
  • Rome, New York
    • CNYWeather.com
Re: NOAA Top Weather Advisory Alerter PHP Script
« Reply #23 on: July 11, 2009, 05:56:14 PM »
ah I mis understood how it was working. Thanks!!  8)
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: NOAA Top Weather Advisory Alerter PHP Script
« Reply #24 on: July 11, 2009, 09:33:35 PM »
Im sure my problem is host related. But can you take a look please..

http://www.snoqualmieweather.com/rss-weather-alerter.php

Ive added a .txt file called "adv-alert-message-WAZ505.txt" Set the permissions too 666 but the file is still empty. I installed this yesterday afternoon. Thanks.
"Nature can do without man, but man cannot do without nature."

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

Offline MCHALLIS

  • Posts: 2,158
  • Long Beach, WA USA
    • Weather for Long Beach, WA USA
Re: NOAA Top Weather Advisory Alerter PHP Script
« Reply #25 on: July 11, 2009, 09:47:57 PM »
Im sure my problem is host related. But can you take a look please..

http://www.snoqualmieweather.com/rss-weather-alerter.php

Ive added a .txt file called "adv-alert-message-WAZ505.txt" Set the permissions too 666 but the file is still empty. I installed this yesterday afternoon. Thanks.

I used the login from the last time I helped you. I just looked and your PHP server has safe_mode on.
That is the reason you continually have problems like this.
I wonder if you can access the php.ini to turn safe_mode off?
« Last Edit: July 11, 2009, 09:50:17 PM by MCHALLIS »

Offline ALITTLEweird1

  • Mark
  • Global Moderator
  • Posts: 5,145
  • North Bend, WA
    • North Bend Weather
Re: NOAA Top Weather Advisory Alerter PHP Script
« Reply #26 on: July 11, 2009, 09:57:10 PM »
I used the login from the last time I helped you. I just looked and your PHP server has safe_mode on.
That is the reason you continually have problems like this.
I wonder if you can access the php.ini to turn safe_mode off?

I cant find that file anywhere. I'll open a ticket with them and ask If it can be turned off. Thanks for looking Mike.
"Nature can do without man, but man cannot do without nature."

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

Offline MCHALLIS

  • Posts: 2,158
  • Long Beach, WA USA
    • Weather for Long Beach, WA USA
Re: NOAA Top Weather Advisory Alerter PHP Script
« Reply #27 on: July 12, 2009, 12:18:55 AM »
Version: 1.07 - 11-Jul-2009 - fixed another bug where the email message had the zone title added twice.
- added feature setting: $message_resend_enabled to allow resending alert messages at pre-determined intervals
some areas can have an active alert like a "High Wind Warning" for more than a day or two.
This feature allows resending the active alert messages like every 12 hours or so

abaldish

  • Guest
Re: NOAA Top Weather Advisory Alerter PHP Script
« Reply #28 on: July 12, 2009, 12:39:55 AM »
Great script again there. But a few questions:

1. This is the type of twitter and phone text message it does: NWS issued: Severe Weather Statement - Cambria (Pennsylvania) for Cambria (Pennsylvania)

Is there a way to modify it in a easy way for us users to make changes to it to say to twitter something like:

NWS issued: Severe Weather Statement - For Cambria County (Pennsylvania)

this way it is not repeating after pa with cambira county again.

thanks!



Offline MCHALLIS

  • Posts: 2,158
  • Long Beach, WA USA
    • Weather for Long Beach, WA USA
Re: NOAA Top Weather Advisory Alerter PHP Script
« Reply #29 on: July 12, 2009, 12:43:18 AM »
What version is doing that double zone title? I thought I fixed that in version 1.07

 

cumulus