NWS Public Alert Messenger PHP Script

How does the script handle multiple alerts? I was noticing it only seems to send the latest one. What happens if there are simultaneous alerts however?

My alerts haven’t been making it to Twitter as of late.
The emails and texts go out as always, just the Twitter is failing.

Mike, before you had the Twitter address as ‘./TweetWX642/’
Now, in your latest update, it is just ‘./TweetWX/’
No more 642?

Is this still a problem from last month Mike’s account was suspended, see the end of this thread?

Apparently so.
Thanks niko.

Now to figure out how to do this on my own. #-o

Now to figure out how to do this on my own.

Try this it works great for me!

Jack

Man, I’m having no luck on this at all.
Downloaded Ken’s TweetWX script and can get the Forecast and Conditions files to send the tweets but the encoding is screwed up.
This is what I get (in different variations when I change encoding)…

NWS fcst: Tonight: Mostly Cloudy, Lo 54°F; Monday: Chance Tstms, Hi 77°F; Monday Night: Chance Tstms, Lo 61°F;
EDIT: Above problem corrected. Still cannot get Alerter script to go.

And still have no luck at all on Mike’s Alerter script. Like I said earlier, no problem with emails and texts. Just the Twitter won’t work.

{ "request": "\/1\/statuses\/update.json", "error": "Incorrect signature" }

Would really like a bit of help on this as hundreds follow my Twitter and Facebook pages and severe weather is expected again today.

I believe my problems lie in the globals.php authorization.
Should the keys start with …
define(‘OAUTH_CONSUMER_KEY’, ---------------------------
define(‘OAUTH_CONSUMER_SECRET’, ------------------------

or should they start with…
$access_token = '-------------------------------------------------------
$access_token_secret = '---------------------------------------------------

???

Ok. Finally figured it out. I was replacing the …
define(‘OAUTH_CONSUMER_KEY’, ---------------------------
define(‘OAUTH_CONSUMER_SECRET’, ------------------------
with the …
$access_token = '-------------------------------------------------------
$access_token_secret = '---------------------------------------------------

Instead I needed to just insert the 2 $access_token lines to the globals.php script at the top above the OAUTH lines.

Thanks! I was having the same issue as you and your solution solved mine too!

Hi installed the program, works good

Just have a few questions, maybe someone can help?
Is there a way to just display nothing, instead of “There are no active watches, warnings or advisories”
also is there a way to display just the

in a page? from the rss-advisory-.txt file

Thanks
Big Dog

bigdog,

There is a setting to disable the message:
// normally when the Advisory is canceled or expires, and the cache is updated,
// it sends out email/text alert stating “There are no active watches, warnings or advisories”.
// disable this?
$disable_expired_message = false; // change to true to disable alert ended alert

Hi, thanks for making this available

I know about that setting that’s not related to what I am doing, I display the content line from the rss-advisoryXXXX-.txt file in another page, wound up using a IF condition to display nothing when matched “There are no active watches, warnings or advisories” I would have rather done that within your script itself instead, that’s what I was trying to do.

also any advice on just displaying the summery within a page?, I did find another weather multi zone script that does that but yours is 90% of exactly what I need with the email etc, so I’d rather just stay with yours, its a bit to complex for me pulling out just the summery part for inclusion in a page.
I am really new at this.

Thanks
Big Dog

Glad to see someone else is having the issues as I with Tweeting.

I have both the $access_token = ‘—’ and the $access_token_secret = ‘—’ already in place on my pages… I am not sure what globals.php is as I do not have this file. Can someone assist a bit more here how to get the conditions, warnings, forecast pages to Tweet please.

Receiving the following error message with the NWS Public Alert Messenger PHP script (going to Twitter):

Twitter: { “error”: “Read-only application cannot POST”, “request”: “/1/statuses/update.json” }
A Twitter was sent:
TEST:NWS issued: There are no active watches, warnings or advisories #weather http://tinyurl.com/m32jh2
Twitter message length: 103

I changed the request settings in the OAuth tool to “POST” but still no luck.

What am I doing wrong?

-wxmanajb

URL Change… In your rss-weather-alerter.php file

Change this…


$RSS_URL = 'http://alerts.weather.gov/cap/wwaatmget.php?x=';

To this…


$RSS_URL = 'http://alerts.weather.gov/cap/wa.php?x=';

And change the /wa.php part to your state abbreviations. Can find the list here… http://alerts.weather.gov/

UPDATE:

The URL has been changed to this…



$RSS_URL = 'http://alerts.weather.gov/cap/wwaatmget.php?x=WAZ505&y=1


Change the WAZ505 to your code. The codes can be found here… http://alerts.weather.gov/

I see that a few post back that wxmanajb posted a problem about posting to twitter but I don’t see a response. I get the following when running through test mode.

Email: (test email setting is enabled in settings)
An email was sent:
Subject: TEST:Advisory
Message: NWS issued: TEST: High Wind Watch for Jefferson (West Virginia)
Email message length: 64

Twitter: { “request”: “/1/statuses/update.json”, “error”: “Read-only application cannot POST” }
A Twitter was sent:
TEST:NWS issued: Winter Weather Advisory #weather http://tinyurl.com/m32jh2
Twitter message length: 75

Thanks,

John

I keep getting the following error when trying to post to twitter. I have double and triple checked all of the OAUTH keys and information.
“Twitter: WARNING: Twitter message not sent (check twitter settings)” I have added the $access_token and $access_token_secret information as well.
SSL port or firewall issue perhaps? I have checked the api.twitter.com status page and it shows that they are not having issues with the update.json script.
Suggestions appreciated. Thanks.

Is there a way to get the Details in the Body of the Email? Currently all I get is the “Title” . I’d like to see Subject Title AND Message Body

for emails.

i.e.
Title:

<title>Flood Advisory</title>

Summary for Message Body:

<summary>The National Weather Service in League City has issued a * Flood Advisory for... Northeastern Galveston County in southeastern Texas... Southeastern Chambers County in southeastern Texas... * Until 700 AM CDT. * At 553 AM CDT, Doppler radar indicated heavy rain due to</summary>

Is it possible to get more details in the tweet? Twitter has expanded the character count and it would be useful to tweet info more than just the event name. Including more details like till when etc. would be useful. The point is to get info out fast, not have to click on a link to find out more details.

Also, line 81,

$RSS_URL = 'http://alerts.weather.gov/cap/wwaatmget.php?x=';

needs to be updated to

$RSS_URL = 'https://alerts.weather.gov/cap/wwaatmget.php?x=';

The site is https only now.