WXforum.net
May 22, 2013, 07:58:18 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
Members: 6617  •  Posts: 178594  •  Topics: 18125
Please welcome TheMOX, our newest member.
Welcome to the the new hosting for WXforum.net.
 
   Home   Help Search Login Register  
Pages: [1]   Go Down
  Print  
Author Topic: NOAA RSS Advisory  (Read 8139 times)
0 Members and 1 Guest are viewing this topic.
capeweather
Administrator
Forecaster
*****
Offline Offline

Posts: 921



WWW
« on: July 31, 2006, 08:39:30 PM »

Ken, I am still using your script and I think it is great.  Very Happy  Lately I have been having an issue going on and thought since you were the author that maybe you could tell me what this means when this error pops up. It's probably just to many connections from other users hitting the site.

Code:
/index.php XML error: syntax error at line 1: Too many connections


I've seen this happen a few times already and once it comes up it completely shuts down all other includes on my page including my NHC Noaa advisory, Weather data, and Radars. I was wondering if it was possible to run the script on my local server by implementing a cron job (downloading the advisory page every 5 minutes by using the get command) or is there a way you could set it up to cache the data? My NHC RSS advisory is running local and works perfect by using a cron job. Do you think that could be a solution? Right now the include for the RSS advisory had to be //. Thanks Ken.

Chris
Logged


Chris
Cape Coral, Florida
Website: http://www.capeweather.com
Website: http://www.fortmyersweather.net
capeweather
Administrator
Forecaster
*****
Offline Offline

Posts: 921



WWW
« Reply #1 on: July 31, 2006, 08:42:13 PM »

Ok, I guess the connections have slowed and it is now working again. Heres a direct link to the RSS feed for the script that I use to include.

http://www.capeweather.com/rss-advisory.php
Logged


Chris
Cape Coral, Florida
Website: http://www.capeweather.com
Website: http://www.fortmyersweather.net
saratogaWX
Administrator
Forecaster
*****
Offline Offline

Posts: 3731


Saratoga, CA, USA Weather - free PHP scripts


WWW
« Reply #2 on: August 01, 2006, 01:09:41 AM »

I could include the caching code which would free up that problem (I think) -- I didn't cache the feeds (either the NOAA RSS or the NHC RSS) because I thought it might delay 'current' info to your viewers.

What cache lifetime do you suggest would be ok?  10 minutes? 5 minutes? more?

Let me know and I'll craft a version with caching.

Best regards,
Ken
Logged

Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis Vantage Pro Plus - FARS, Boltek-PCI/NexStorm, GRLevel3, WD, WL, VWS, Cumulus, Meteohub
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP
capeweather
Administrator
Forecaster
*****
Offline Offline

Posts: 921



WWW
« Reply #3 on: August 01, 2006, 01:13:53 AM »

I guess the night owls are up tonight Ken!  Very Happy Umm, I would think 5 minutes would be ok...I guess there must have been a lot of people hitting NOAA's site today because it had the "too many connections" post on there.  Shocked Anyhow, its whatever you think would be right.  Very Happy Thanks again.
Logged


Chris
Cape Coral, Florida
Website: http://www.capeweather.com
Website: http://www.fortmyersweather.net
saratogaWX
Administrator
Forecaster
*****
Offline Offline

Posts: 3731


Saratoga, CA, USA Weather - free PHP scripts


WWW
« Reply #4 on: August 01, 2006, 02:44:09 AM »

I'll post some code tomorrow.. the wife has a bridge party here, and I'm doing butler duty -- but inbetween butler times, I can happily code Smile
Ken
Logged

Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis Vantage Pro Plus - FARS, Boltek-PCI/NexStorm, GRLevel3, WD, WL, VWS, Cumulus, Meteohub
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP
Gordon
Senior Member
**
Offline Offline

Posts: 77



WWW
« Reply #5 on: August 02, 2006, 08:22:22 PM »

Ken,

Is it possible to modify your advisory script to display just the advisory and not the accompaning "click the link above to see details..." message?

I attempted to comment out the following code

// end of main program
if ($doSummary) {
  print $Summary;
  if ($WLink) {
    print "Click on the link";
   if ($WLink > 1) {echo "s";}
   print " above to see details on the $WLink NOAA advisor";
   if ($WLink > 1) {echo "ies"; } else { echo "y"; };
   echo " for zone $Zone.\n";
  }

without success.

If need be, feel free to stop by http://oldlineweather.com to see what I'm talking about.

Thanks,
Logged

Gordon
Old Line Weather
Davis VantageVue
Weather Display v10.37R b40
saratogaWX
Administrator
Forecaster
*****
Offline Offline

Posts: 3731


Saratoga, CA, USA Weather - free PHP scripts


WWW
« Reply #6 on: August 04, 2006, 12:27:42 AM »

Gordon:

You can lose just the 'click on the...' line by doing this:

Code:
if ($doSummary) {
 print $Summary;
 if (false) { // don't execute this
   print "Click on the link";
   if ($WLink > 1) {echo "s";}
   print " above to see details on the $WLink NOAA advisor";
   if ($WLink > 1) {echo "ies"; } else { echo "y"; };
   echo " for zone $Zone.\n";
  }
}


adding the 'false' in the test to see if there were any summaries just makes the following code in the IF never be executed Smile

Alternatively, you could just comment out the lines like this:
Code:
You can lose just the 'click on the...' line by doing this:

if ($doSummary) {
 print $Summary;
// if ($WLink) {
//   if ($WLink > 1) {echo "s";}
//   print " above to see details on the $WLink NOAA advisor";
//   if ($WLink > 1) {echo "ies"; } else { echo "y"; };
//   echo " for zone $Zone.\n";
// }
}


Best regards,
Ken
Logged

Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis Vantage Pro Plus - FARS, Boltek-PCI/NexStorm, GRLevel3, WD, WL, VWS, Cumulus, Meteohub
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP
Gordon
Senior Member
**
Offline Offline

Posts: 77



WWW
« Reply #7 on: August 04, 2006, 11:29:42 AM »

Quote from: "kenmtrue"

You can lose just the 'click on the...' line by doing this:


Ken,

Thanks for that!
Logged

Gordon
Old Line Weather
Davis VantageVue
Weather Display v10.37R b40
saratogaWX
Administrator
Forecaster
*****
Offline Offline

Posts: 3731


Saratoga, CA, USA Weather - free PHP scripts


WWW
« Reply #8 on: August 17, 2006, 12:24:20 AM »

All done, and thanks for testing it Chris!

The new rss-advisory script does cache the XML for 10 minutes (adjustable) and so lessens the load on www.weather.gov.

http://saratoga-weather.org/scripts-rss.php

Best regards,
Ken
Logged

Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis Vantage Pro Plus - FARS, Boltek-PCI/NexStorm, GRLevel3, WD, WL, VWS, Cumulus, Meteohub
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP
capeweather
Administrator
Forecaster
*****
Offline Offline

Posts: 921



WWW
« Reply #9 on: August 17, 2006, 12:51:34 AM »

Thank you Ken! It works perfect!  Applause
Logged


Chris
Cape Coral, Florida
Website: http://www.capeweather.com
Website: http://www.fortmyersweather.net
capeweather
Administrator
Forecaster
*****
Offline Offline

Posts: 921



WWW
« Reply #10 on: August 21, 2006, 04:07:37 PM »

Ken, have any idea why this would be happening? Just started a little bit ago and had to disable. I'm wondering if the NOAA servers are down or something.

Chris

Code:
/rss-advisory-cache.php XML error: syntax error at line 1: <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"> <HTML><HEAD> <TITLE>404 Not Found</TITLE> </HEAD><BODY> <H1>Not Found</H1> The requested URL /alerts/wwarssget.php was not found on this server.<P> <P>Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request. <HR> <ADDRESS>Apache/1.3.36 Server at p320011.totalcontrol.host Port 80</ADDRESS> </BODY></HTML>
Logged


Chris
Cape Coral, Florida
Website: http://www.capeweather.com
Website: http://www.fortmyersweather.net
saratogaWX
Administrator
Forecaster
*****
Offline Offline

Posts: 3731


Saratoga, CA, USA Weather - free PHP scripts


WWW
« Reply #11 on: August 21, 2006, 05:09:12 PM »

Wow, that is strange  Shocked

From the messages, it looked like the server wasn't coughing up the /alerts/wwarssget.php page (source of the RSS feed) for a bit.

Is it still happening?

What Zone are you using?

My zone is getting data:
CAZ513
http://www.weather.gov/alerts/wwarssget.php?zone=CAZ513
http://saratoga-weather.org/rss-advisory-test.php?zone=CAZ513

Best regards,
Ken
Logged

Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis Vantage Pro Plus - FARS, Boltek-PCI/NexStorm, GRLevel3, WD, WL, VWS, Cumulus, Meteohub
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP
capeweather
Administrator
Forecaster
*****
Offline Offline

Posts: 921



WWW
« Reply #12 on: August 21, 2006, 05:14:53 PM »

Hi Ken, I'm using zone ID FLZ065. It hasnt happened in about an hour so maybe the servers are back to normal.

Chris
Logged


Chris
Cape Coral, Florida
Website: http://www.capeweather.com
Website: http://www.fortmyersweather.net
capeweather
Administrator
Forecaster
*****
Offline Offline

Posts: 921



WWW
« Reply #13 on: August 21, 2006, 06:31:48 PM »

Ken,
Just happened again so I had to take it down for a bit. I'm suspecting NOAA's servers at this point.

Chris
Logged


Chris
Cape Coral, Florida
Website: http://www.capeweather.com
Website: http://www.fortmyersweather.net
capeweather
Administrator
Forecaster
*****
Offline Offline

Posts: 921



WWW
« Reply #14 on: August 22, 2006, 11:48:55 PM »

Ken, today everything went fine. Just wanted to give you a quick update.  Very Happy
Logged


Chris
Cape Coral, Florida
Website: http://www.capeweather.com
Website: http://www.fortmyersweather.net
saratogaWX
Administrator
Forecaster
*****
Offline Offline

Posts: 3731


Saratoga, CA, USA Weather - free PHP scripts


WWW
« Reply #15 on: December 17, 2007, 02:58:33 PM »

This script has been updated with new security features (thanks to MCHALLIS) and a new access method (file instead of URL include) to support PHP5 installations that have allow_url_include = off.

Docs and download at http://saratoga-weather.org/scripts-rss.php#NOAARSS

Best regards,
Ken
Logged

Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis Vantage Pro Plus - FARS, Boltek-PCI/NexStorm, GRLevel3, WD, WL, VWS, Cumulus, Meteohub
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP
Pages: [1]   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.118 seconds with 19 queries.