Author Topic: multiple nws-alerts  (Read 1241 times)

0 Members and 1 Guest are viewing this topic.

Offline txweather.org

  • Forecaster
  • *****
  • Posts: 1597
    • Texas Weather
multiple nws-alerts
« on: June 02, 2014, 04:28:51 PM »
Team,

Is it possible to have multiple alerts display on the status of nws alerts on the front page?

Right now it only shows one. It's also complaining that I have multiple alerts configured with no cron. I do have a cron but is remote not local s I had to suppress the error mesg for now.

Ideas?

TIA!

----
Davis Vantage Pro2 Plus +FARS|Meteobridge Nano SD|Meteohub|Meteobridge MR-3020|WU KTXSPRIN75/PWS JRARGWX75/CWOP EW2972/WBB TXWDVUE75/Blitzortung ID: 1142|AWEKAS: 12095
Donations are welcome: https://paypal.me/ffuentesb

Offline cospringswx

  • Forecaster
  • *****
  • Posts: 4136
    • Colorado Springs Weather
Re: multiple nws-alerts
« Reply #1 on: June 02, 2014, 05:26:16 PM »
On nws-alerts.php find line 113 and set to false to get rid of the error message.

Code: [Select]
if($cmyzc > 4 and $noCron == false) {


As far as the cron is concerned I use a vbs script to check for alerts from the NWS. I run it with Task Scheduler.


Here are my settings within nws-alerts-config.php

Code: [Select]
// ALERT BOX SETTINGS
$useAlertBox   = true;                      // true=use alert box & write data file   false= not using alert box & don't write file
$titleNewline  = true;                      // true=new line for each title   false=string titles with other titles
$aBox_Width    = '99%';                     // width of box  examples - $aBox_Width = '80%';  $aBox_Width = '850px';  or smallest box  $aBox_Width = '';
$centerText    = true;                     // true=center text in alert box    false=left align text
$showNone      = true;                     // true=show 'NONE' if no alerts in alert box   false=don't show alert box if no alerts
$locSort       = 1;                         // location name sort - use number listed below
//                                             0 = sort location as listed in $myZC array
//                                             1 = sort location alphabetically

$sortbyEvent   = 3;                         // sort titles by severity in alert box & then by number listed below
//                                             0 = location - duplicate events will be displayed
//                                             1 = location - duplicate events removed
//                                             2 = event - duplicate events will be displayed
//                                             3 = event - duplicate events removed


// BIG ICONS
$iconLimit     = 0;                         // the number of icons to display  0=show all
$addNone       = true;                     // true=add NONE foreach location with no alerts        false= don't show any NONE
$shoNone       = true;                      // true=show one 'NONE' if no alerts for all location   false=don't show one 'NONE' if no alerts for all location
$useIcons      = 3;                         // select number below
//                                             0 = don't use icons - the cache file will not be written
//                                             1 = sort by alert - duplicate events will be displayed
//                                             2 = sort by alert - duplicate events removed
//                                             3 = single top alert icon for each location
//                                             4 = sort by location - duplicate removed
//                                             5 = sort by location - duplicate events will be displayed


« Last Edit: June 02, 2014, 05:40:39 PM by cospringswx »




Ryan 

Colorado Springs, CO
www.cospringsweather.com
Davis Vantage Vue
Weather Display Software
Amcrest HD IP Camera

Offline cospringswx

  • Forecaster
  • *****
  • Posts: 4136
    • Colorado Springs Weather
Re: multiple nws-alerts
« Reply #2 on: June 02, 2014, 06:15:00 PM »
Looks like you got it. \:D/




Ryan 

Colorado Springs, CO
www.cospringsweather.com
Davis Vantage Vue
Weather Display Software
Amcrest HD IP Camera

Offline txweather.org

  • Forecaster
  • *****
  • Posts: 1597
    • Texas Weather
Re: multiple nws-alerts
« Reply #3 on: June 02, 2014, 06:19:49 PM »
Looks like you got it. \:D/

Yes Sr.

Thank you very much for the tip! :D

Regards.

----
Davis Vantage Pro2 Plus +FARS|Meteobridge Nano SD|Meteohub|Meteobridge MR-3020|WU KTXSPRIN75/PWS JRARGWX75/CWOP EW2972/WBB TXWDVUE75/Blitzortung ID: 1142|AWEKAS: 12095
Donations are welcome: https://paypal.me/ffuentesb

Offline cospringswx

  • Forecaster
  • *****
  • Posts: 4136
    • Colorado Springs Weather
Re: multiple nws-alerts
« Reply #4 on: June 02, 2014, 06:45:28 PM »
Glad to help. :grin:




Ryan 

Colorado Springs, CO
www.cospringsweather.com
Davis Vantage Vue
Weather Display Software
Amcrest HD IP Camera

Offline Curly

  • Forecaster
  • *****
  • Posts: 724
    • Michiana Weather
Re: multiple nws-alerts
« Reply #5 on: June 02, 2014, 07:07:50 PM »
With 4 or more codes to fetch, the script will complain about using a cron job if disabled in the settings.
Code: [Select]
$noCron        = false;                     // true=not using cron, update data when cache file expires   false=use cron to update data

If the source of the data is busy, it could take 6 seconds to fetch the data for each code. Having 4 locations with 2 codes each, the processing time for the data download would be at least 48 seconds.
After the script finishes the processing, the index page will then proceed to load.
That's a lot of time to wait for the main index page to load so I highly recommend a cron job or a similar way to run the script at intervals.
As mentioned, the Windows Task Scheduler is very reliable and easy to set up.
« Last Edit: June 02, 2014, 07:30:32 PM by Curly »

Offline txweather.org

  • Forecaster
  • *****
  • Posts: 1597
    • Texas Weather
Re: multiple nws-alerts
« Reply #6 on: June 02, 2014, 07:51:00 PM »
With 4 or more codes to fetch, the script will complain about using a cron job if disabled in the settings.
Code: [Select]
$noCron        = false;                     // true=not using cron, update data when cache file expires   false=use cron to update data

If the source of the data is busy, it could take 6 seconds to fetch the data for each code. Having 4 locations with 2 codes each, the processing time for the data download would be at least 48 seconds.
After the script finishes the processing, the index page will then proceed to load.
That's a lot of time to wait for the main index page to load so I highly recommend a cron job or a similar way to run the script at intervals.
As mentioned, the Windows Task Scheduler is very reliable and easy to set up.

Curly,

Thanks for tip.
I do have a cronjob setup but is not local to the system. Is a remote cron via one of my systems.

Code: [Select]
*/5 * * * * /usr/local/bin/wget -O - http://txweather.org/nws-alerts.php > /dev/null 2>&1

If I am not mistaken this should work.

Thoughts?

----
Davis Vantage Pro2 Plus +FARS|Meteobridge Nano SD|Meteohub|Meteobridge MR-3020|WU KTXSPRIN75/PWS JRARGWX75/CWOP EW2972/WBB TXWDVUE75/Blitzortung ID: 1142|AWEKAS: 12095
Donations are welcome: https://paypal.me/ffuentesb

Offline txweather.org

  • Forecaster
  • *****
  • Posts: 1597
    • Texas Weather
Re: multiple nws-alerts
« Reply #7 on: June 02, 2014, 07:54:01 PM »
Or maybe a curl?

----
Davis Vantage Pro2 Plus +FARS|Meteobridge Nano SD|Meteohub|Meteobridge MR-3020|WU KTXSPRIN75/PWS JRARGWX75/CWOP EW2972/WBB TXWDVUE75/Blitzortung ID: 1142|AWEKAS: 12095
Donations are welcome: https://paypal.me/ffuentesb