WXforum.net
June 19, 2013, 06:09:11 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
Members: 6695  •  Posts: 181358  •  Topics: 18410
Please welcome KD0RII, our newest member.
Welcome to the the new hosting for WXforum.net.
 
   Home   Help Search Login Register  
Pages: [1] 2   Go Down
  Print  
Author Topic: Multiple alerts on SWSP script  (Read 2308 times)
0 Members and 1 Guest are viewing this topic.
ctccbc
Senior Contributor
****
Offline Offline

Posts: 152

Acurite 01035, Weather Display


WWW
« on: July 02, 2012, 06:28:29 AM »

I've been using the SWSP script for watches, warnings and advisories on my front page for a few weeks. So far, I've never been able to get more than one headline to appear, even when we have multiple headlines in effect. This was a bit troubling last week when we had a "Special Weather Statement", but it was overriden by a "Air Quality Alert". How do I configure the script to show both headlines?

Thanks,
Chris
moreheadcityweather.com

Logged

Gootch
Senior Member
**
Offline Offline

Posts: 78



WWW
« Reply #1 on: July 02, 2012, 08:46:42 AM »

Hi Chris

In my SWSP-config.php file I have this setting set to  true and my alerts display on seperate lines i dont know if that is what you are looking for but it works for me.
This should be set to true line 25 on my file              $newLine = true;     // true=a new line for each type of alert  false=string alerts types

Hope that helps   Andy

I've been using the SWSP script for watches, warnings and advisories on my front page for a few weeks. So far, I've never been able to get more than one headline to appear, even when we have multiple headlines in effect. This was a bit troubling last week when we had a "Special Weather Statement", but it was overriden by a "Air Quality Alert". How do I configure the script to show both headlines?

Thanks,
Chris
moreheadcityweather.com


Logged

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

Curly
Forecaster
*****
Online Online

Posts: 477


WWW
« Reply #2 on: July 02, 2012, 09:05:53 AM »

That is a limitation of that script.
It only shows the top alert in the alert box but it should show all alerts for that location when clicked.

The script gets one alert title for a location on the first page fetch from the NWS and that is from the WFO page with the color coded map with the legend.
Looking at the map and the color coded legend, there is only ONE alert for each color.
Now the alert box has the alert title for each location and that is 'set in stone' and used in the alert box.

That first WFO page that was already fetched also has the links to all other alerts for that location and then the script fetches the data at each one of those links.
At times, the NWS gets bogged down (under various conditions), and downloading that data could take up to several seconds to get one alert. That doesn't seem long but getting multiple alerts could take a minute or so.
To put all of the alert titles in the alert box, the page with the alert box would not load until the script finishes processing all of the alerts in that period of time.
That would drive most visitors away from that page....

This is why there is one alert title per location.
Logged
Gootch
Senior Member
**
Offline Offline

Posts: 78



WWW
« Reply #3 on: July 02, 2012, 11:19:18 AM »

Question for Curly

Hi Curly

I was wondering what code would be used to print a message at the bottom of the alert window that says "Click on county name for more details" or something to that effect.

Thank You  Andy
Logged

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

Curly
Forecaster
*****
Online Online

Posts: 477


WWW
« Reply #4 on: July 02, 2012, 01:59:34 PM »

Quote
I was wondering what code would be used to print a message at the bottom of the alert window that says "Click on county name for more details" or something to that effect.

A mouse-over shows "Click for details".
If you want to add the text to the bottom of the alert box, open SWSP-core.php
Find the following lines:
Code:
      foreach($sec_alrts as $sak => $sav) {  // formatted data string for all alerts
        $alertBoxText .= $sav;   
      }

Replace those lines with these:
Code:
      foreach($sec_alrts as $sak => $sav) {  // formatted data string for all alerts
        $alertBoxText .= $sav;   
      }
      $alertBoxText = $alertBoxText . "   <br /> Click on county name for more details\n";   

Save the file and upload it.
The next update will show the change.
Logged
Curly
Forecaster
*****
Online Online

Posts: 477


WWW
« Reply #5 on: July 02, 2012, 05:45:34 PM »

This isn't good.

The NWS changed everything this afternoon and their SWSP doesn't exists at this time.
So far the maps are still there!
I'm still searching for it.
Logged
DaculaWeather
It's a Jeep thing... you wouldn't understand.
Forecaster
*****
Offline Offline

Posts: 2783


SCCA EM #156


WWW
« Reply #6 on: July 02, 2012, 06:00:30 PM »

your script appears to still be working for me.
Logged

Steve
Davis Vue, VWS, WDisplay, VVP, StartWatch CWOP 

n3ouc
Contributor
***
Offline Offline

Posts: 105



WWW
« Reply #7 on: July 02, 2012, 06:08:21 PM »

The maps are there but the text part of the script shows no information found..

 d'oh!

Mike
Logged

Mike Stanton
Air Products Campus Weather
DaculaWeather
It's a Jeep thing... you wouldn't understand.
Forecaster
*****
Offline Offline

Posts: 2783


SCCA EM #156


WWW
« Reply #8 on: July 02, 2012, 06:09:06 PM »

I see my HWO from the script but that's it.
Logged

Steve
Davis Vue, VWS, WDisplay, VVP, StartWatch CWOP 

Curly
Forecaster
*****
Online Online

Posts: 477


WWW
« Reply #9 on: July 02, 2012, 06:10:17 PM »

Your WFO must have their page intact.
If you select another WFO, it's showing no alerts.
Logged
DaculaWeather
It's a Jeep thing... you wouldn't understand.
Forecaster
*****
Offline Offline

Posts: 2783


SCCA EM #156


WWW
« Reply #10 on: July 02, 2012, 06:10:42 PM »

Yes.
Logged

Steve
Davis Vue, VWS, WDisplay, VVP, StartWatch CWOP 

SoMDWx
Forecaster
*****
Offline Offline

Posts: 624



WWW
« Reply #11 on: July 02, 2012, 06:11:39 PM »

Crap! Does this mean the SWSAlerts scripts MUST be changed also?
Logged

Jim Wyman
Certificate In Weather Forecasting Graduate, Fall '11, PSU
Creator of Scit Pro
Southern Maryland Weather
http://somdweather.com
http://scit.somdweather.com
DaculaWeather
It's a Jeep thing... you wouldn't understand.
Forecaster
*****
Offline Offline

Posts: 2783


SCCA EM #156


WWW
« Reply #12 on: July 02, 2012, 06:13:45 PM »

Yes
Logged

Steve
Davis Vue, VWS, WDisplay, VVP, StartWatch CWOP 

Curly
Forecaster
*****
Online Online

Posts: 477


WWW
« Reply #13 on: July 02, 2012, 06:19:17 PM »

Quote
Crap! Does this mean the SWSAlerts scripts MUST be changed also?

Found a fix for now!

The southern region headquarters still has this data so a line change can fix this.
Open SWSP-core.php
Find this line:
Code:
$NWSurl = 'http://forecast.weather.gov';  //  NWS URL

Replace it with this line:
Code:
$NWSurl = 'http://www.srh.noaa.gov';  //  NWS URL


Older versions may have a different URL listed. If you have an older version, Find each instance of this:
Code:
$NWSurl = 'http://

Replace the entire line with this:
Code:
$NWSurl = 'http://www.srh.noaa.gov';  //  NWS URL

« Last Edit: July 02, 2012, 07:04:00 PM by Curly » Logged
ctccbc
Senior Contributor
****
Offline Offline

Posts: 152

Acurite 01035, Weather Display


WWW
« Reply #14 on: July 02, 2012, 07:20:25 PM »

That fixes the actual script, but will it also fix the alert box? Seems like it hasn't changed here. We have a Hazardous Weather Outlook in effect and it doesn't show it.

Thanks,
Chris
moreheadcityweather.com
Logged

DaculaWeather
It's a Jeep thing... you wouldn't understand.
Forecaster
*****
Offline Offline

Posts: 2783


SCCA EM #156


WWW
« Reply #15 on: July 02, 2012, 07:24:14 PM »

You da man!  Applause Great job Curly!!!
« Last Edit: July 02, 2012, 07:27:59 PM by DaculaWeather » Logged

Steve
Davis Vue, VWS, WDisplay, VVP, StartWatch CWOP 

DaculaWeather
It's a Jeep thing... you wouldn't understand.
Forecaster
*****
Offline Offline

Posts: 2783


SCCA EM #156


WWW
« Reply #16 on: July 02, 2012, 07:28:55 PM »

I've discovered that the southern Region seems to have much more data like this than the other regions.
Logged

Steve
Davis Vue, VWS, WDisplay, VVP, StartWatch CWOP 

ctccbc
Senior Contributor
****
Offline Offline

Posts: 152

Acurite 01035, Weather Display


WWW
« Reply #17 on: July 02, 2012, 07:33:16 PM »

Nevermind, the Hazardous Weather Outlook just appeared in my alert box!  Now to fix the forecast and the marine forecast!

Logged

gwwilk
Southeast Lincoln Weather
Forecaster
*****
Offline Offline

Posts: 527



WWW
« Reply #18 on: July 02, 2012, 07:34:34 PM »

Quote
Crap! Does this mean the SWSAlerts scripts MUST be changed also?

Found a fix for now!

The southern region headquarters still has this data so a line change can fix this.
Open SWSP-core.php
Find this line:
Code:
$NWSurl = 'http://forecast.weather.gov';  //  NWS URL

Replace it with this line:
Code:
$NWSurl = 'http://www.srh.noaa.gov';  //  NWS URL


Older versions may have a different URL listed. If you have an older version, Find each instance of this:
Code:
$NWSurl = 'http://

Replace the entire line with this:
Code:
$NWSurl = 'http://www.srh.noaa.gov';  //  NWS URL



I used the NWS Central Region's Data by changing the above line to
Code:
$NWSurl = 'http://www.crh.noaa.gov';  //  NWS URL
and the script is working here as well.
« Last Edit: July 02, 2012, 07:36:10 PM by gwwilk » Logged

dasman
Forecaster
*****
Offline Offline

Posts: 340



WWW
« Reply #19 on: July 02, 2012, 07:37:03 PM »

The SWSP is working again for me with "NO" fix on my part. It is divine intervention.
 http://www.peotoneweather.com/niadvisory.php.
Logged

Dave Sommerfed
Peotone Illinois USA
CW7762, KILPEOT1
NWS COOP, CoCoRaHS, Spotter Network
Curly
Forecaster
*****
Online Online

Posts: 477


WWW
« Reply #20 on: July 02, 2012, 07:38:33 PM »

They sure are giving us the run around....

Seems to be late for an April Fools joke.
Logged
gwwilk
Southeast Lincoln Weather
Forecaster
*****
Offline Offline

Posts: 527



WWW
« Reply #21 on: July 02, 2012, 07:47:43 PM »

How do we flush the cache with these scripts, Curly?
Logged

Curly
Forecaster
*****
Online Online

Posts: 477


WWW
« Reply #22 on: July 02, 2012, 08:00:44 PM »

How do we flush the cache with these scripts, Curly?

Find the cache folder that is set at $dataFolder in the SWSP-config.php file and then delete the file SWSPdatacache.php in that cache folder.
Logged
DougW
Forecaster
*****
Online Online

Posts: 371


WWW
« Reply #23 on: July 02, 2012, 08:07:37 PM »

Curly, your so good you must have 'scared' your script into working  Applause

Doug
« Last Edit: July 02, 2012, 08:11:04 PM by DougW » Logged

gwwilk
Southeast Lincoln Weather
Forecaster
*****
Offline Offline

Posts: 527



WWW
« Reply #24 on: July 02, 2012, 08:15:05 PM »

I went back to the original SWSP-core.php configuration, flushed the cache, and now the local alerts, http://www.gwwilkins.org/NWS-LocalAlerts.php are working as are the US alerts at http://www.gwwilkins.org/NWS-ConUSAlerts.php.  (I was looking at a 'localhosts' version of my web site when I said it wasn't working. Embarassed)
« Last Edit: July 02, 2012, 08:17:53 PM by gwwilk » Logged

Pages: [1] 2   Go Up
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!
Page created in 0.117 seconds with 19 queries.