script to automate spotter reports

Thanks to Ken True and Tom Chaplin, who let me borrow their code, I have written a script which automates sending spotter reports via email to local TV and radio stations .

Please consult with your local meteorologists before using this script!

This script requires Ken True’s testtags.php file which can be uploaded using these instructions (swiped from the WD readme.txt file):

[b]Use the Weather-Display Control Panel, Web Files/Web Page/Real Time FTP/WDL, Custom Web Page Setup TAB.

In the ‘Special file conversion’ area

put: testtags.txt in Local File 2
testtags.php in Remote file name 2

Turn the switch to ON

Press Test

Press OK to save the settings.[/b]

Also, you will need to upload the dailylog.txt created by WD with the following Steps:

[b]In Weather Display…

Select Control Panel…FTP & Connections METAR/NOAA

Click Choose the file and navigate to the logfiles subdirectory of Weather Display and select dailylog.txt. Click Open.

Click Select this file. This should add dailylog.txt to the local and remote filename boxes. Make sure the switch is on, click save changes and click ok.
[/b]

Grab the attached zip file, unzip and upload the two files to your web server.

You will now need to create a cron job, or have some other way to automatically call the script.

My cron job (1and1.com) looks like this: (others may vary)

30 4,16,22 * * * /usr/bin/php /path-to-script/storm-reports.php 2>&1 /dev/null.

The path can be determined by running hardpath.php from this post: http://discourse.weather-watch.com/t/28585 located in the files.zip that is attached.

You should remove hardpath.php once you have determined the path.

This cron job calls the script at 4:30am, 4:30pm and 10:30pm. It sends nothing to the meteorologists unless the limits are reached but sends a confirmation email to your email address.

I will try to help as best I can with questions.


storm-reports.zip (1.98 KB)