Ken True of Saratoga Weather

Current wugraphs-scripts should also be removed or at least hidden from public immedately as they are able to kill the webservers.
Tested here by trying to load 3 graphs (what never appeared) on a site living on same server as my site do and the dual-core webserver got almost killed (loads rised above 6), because the scripts never end. Only way to get ride of them was to restart whole webserver.

Status update:

I talked via email with John Celenza of WeatherUnderground and the issue with the WU-forecast.php script was caused by an IP block by WunderGround on my serverā€™s IP address. They have kindly removed the block, and the script works again.

I did do an update to WU-forecast.php V1.28 tonight to add the ability to follow the 301 redirect to their block.asp page, and cache the contents in the cache file. If it happens that you find no forecast, even after doing a ?force=1 to force a cache refresh, then check the contents of your cache file (do a view source on the page to find the name/location of the file), and in the file will be the text of the block page ā€¦ you can use the IP address there to contact WU to ask the block be removed.

I also changed the request to include a User-agent: PHP,WU-forecast.php,saratoga-weather.org so they can identify that the request was made by the WU-forecast.php script (and that they should contact me for questions).

Sorry for the alarm ā€¦ in short:

  1. WU was blocking some IPs for excessive traffic (I think)
  2. The script couldnā€™t get past the block, so stopped offering you a forecast.
  3. the updated script V1.28 has diagnostics to help you put a request to WU to unblock if it happens to you

I am working (and about 80% finished) with a WU API JSON script and will release it later, but the WU-forecast.php can live on to serve :slight_smile:

Best regards,
Ken

Hmm? i still can not get a forecast i have cleared cash and tried another computer that has never had my site on it still no forecast, am i missing something?

Lolā€¦you say if it doesnt work do a view source and get the location??? OK if your a programmer maybe but what am i looking at??? i have no idea? :?

Bogget
www.realweather.net

Hi Bogget,

There are two issues I found by doing a view-source on http://www.realweather.net/wxforecast.php?force=1

First, the script youā€™re running is not the updated one (V1.28) so it wouldnā€™t help diagnose the block.
Second, your cache file ./cache/WU-forecast-en.txt is not writable, so even if the script were updated, weā€™d not be able to read the cache file to see what address needs to be unblocked.

I suggest you update the script, and make the ./cache/ directory writable, the run the query again for further diagnostics.

Best regards,
Ken

Hi Ken, OK i will update now i assume this is the page we are talking about so i need a template from your site, and where is this cash and how do i make it writeable and why has it stopped being writable?

Bogget

Ok updated now, i found a folder on both my back up of the website and on the website called cache and nothing in either? foler is not in anyway restricted as far as i know, and wc-forcast.txt is blank but properties say its writable i dont have a WU-forecast-en.txt and never have as far as i know?

Just created a WU-forecast-en.txt and uploaded it still not working?

i do wish i knew more about programming?

Bogget
www.realweather.net

Hi Bogget,

The page shows the correct version of the script, but the ./cache/ is not writable by PHP

You might try changing permissions on the ./cache/ directory itself to 777 to make it writable.

Is your WU-forecast-en.txt in a cache directory on the website, or is it in the root like mine isā€¦?

Iā€™ve just been updating this, and mine was blocked, so Iā€™ve contacted WU support.

I have discovered another problem thoughā€¦ since updating my WU-Forecast.php file i get:

ā€œWarning: Division by zero in /virtual/users/e17230-18941/web/WU-forecast.php on line 746ā€ at the top of the home and forecast webpagesā€¦??

Daryll.

Hi Daryll,

Looking at your wxforecast.php?force=1 page shows

and your ./WU-forecast-0-en.txt contents shows

HTTP/1.1 200 OK
Date: Sat, 04 Feb 2012 19:27:14 GMT
Server: Apache/1.3.33 (Unix) PHP/4.4.0
Cache-control: no-cache, must-revalidate, no-cache=ā€œSet-Cookieā€, private
Expires: Fri, 01 Jan 1990 00:00:00 GMT
Pragma: no-cache
X-CreationTime: 0.024
Set-Cookie: ASC=1328383634:1; path=/; expires=Fri, 01-Jan-2020 00:00:00 GMT; domain=.wunderground.com
Set-Cookie: DT=1328383634:27320:365-t1; path=/; expires=Fri, 01-Jan-2020 00:00:00 GMT; domain=.wunderground.com
Connection: close
Transfer-Encoding: chunked
Content-Type: text/html; charset=UTF-8

106
Request Blocked

Your request to Wunderground.com has been blocked. To get this block removed, please contact wunderground.com:

Your IP is 74.52.111.11, USER_AGENT PHP,WU-forecast.php,saratoga-weather.org

Email: [email protected]

0

So send along a note to [email protected] asking that 74.52.111.11 IP address be unblocked.

Best regards,
Ken

Hi Ken, and thanks for your speedy responsesā€¦

As I mentioned, Iā€™ve contacted WU support and asked them to unblock that IPā€¦ (i copied and pasted the last few lines from the cache file into the email)

The thing that concerned me was the error messageā€¦?? or is this just a consequence of the IP being blockedā€¦?

Daryll

The Warning: error message was just due to the script not finding a valid cache of the WU forecast page ā€¦ it will go away when the block is removed.

Best regards,
Ken

Excellent, many thanks Ken

Daryll.

OK set it to 777 and still nothing, my wu text file is same directory as html pages that is root.

Bogget

Hi Bogget,

Looking at the view-source of http://www.realweather.net/wxforecast.php shows

So the cache is now working, and looking at the cache file at http://www.realweather.net/cache/WU-forecast-0-en.txt shows

HTTP/1.1 200 OK
Date: Sat, 04 Feb 2012 20:56:22 GMT
Server: Apache/1.3.33 (Unix) PHP/4.4.0
Cache-control: no-cache, must-revalidate, no-cache=ā€œSet-Cookieā€, private
Expires: Fri, 01 Jan 1990 00:00:00 GMT
Pragma: no-cache
X-CreationTime: 0.050
Set-Cookie: ASC=1328388982:1; path=/; expires=Fri, 01-Jan-2020 00:00:00 GMT; domain=.wunderground.com
Set-Cookie: DT=1328388982:27057:365-u4; path=/; expires=Fri, 01-Jan-2020 00:00:00 GMT; domain=.wunderground.com
Connection: close
Transfer-Encoding: chunked
Content-Type: text/html; charset=UTF-8

106
Request Blocked

Your request to Wunderground.com has been blocked. To get this block removed, please contact wunderground.com:

Your IP is 74.52.111.11, USER_AGENT PHP,WU-forecast.php,saratoga-weather.org

Email: [email protected]

0


so you need to send a request to [email protected] requesting that IP 74.52.111.11 be unblocked.

When it is unblocked, youā€™ll see your forecasts again :slight_smile:

Best regards,
Ken

p.s. It would be helpful if you put the URL of your website in your profile so we donā€™t have to search for it in prior postings :slight_smile:

Thank you Ken, once again.

i have just seen a site with WXSIM i didnt realise that worked in the UK?

is that any better than the one i am using?

Bogget

Hi Bogget,

WXSIM is a purchased software from www.wxsim.com that allows you to run your own forecasts based on meteo data. Many of us have found it useful for our websites, and I do have a formatting script that processes the text output of the WXSIM program to create reports like the WU and NWS forecasts.

WXSIM will work anywhere in the world, but you have to buy a license for it and have it customized for your locale by the author Tom Ehrensberger.

See the WXSIM forum here for posts about using WXSIM.

I personally think that Tom has done an outstanding job creating a weather modeling program that runs on a PC with output that closely matches what the ā€˜big guysā€™ with their supercomputer models can produce. :slight_smile: 8) =D>

Best regards,
Ken

Yes it does look great, but for me i dont need all the bells and whistles it provides, i dont think i would use it all, your excellent script also gives great forecasting and your support is second to none. you have never failed to sort any of the problems i have had (and i have had a few).

so i thnk another contribution to your supprt fund and a thank you.

Bogget :slight_smile:

Thanks for the kind words, Bogget! And thanks for the donation too :slight_smile:

Best regards,
Ken

Just a follow-up to thisā€¦ after a day or 2 I started getting the forecasts again.

Iā€™ve just had an email from WU where they say:
ā€œWe have unblocked your IP. Please note that there was an error in the script that you were using that caused the block. Please make sure that you now use the patched script to obtain the data.ā€

Hmmmā€¦ the script worked fine until they started changing thingsā€¦!!! 8O

Hi Daryll,

I see you are running the latest version of WU-forecast.php which does include the ā€œUser-agent: PHP,WU-forecast.php,saratoga-weather.orgā€ on the request. That will help them identify that the request should be honoredā€¦ the older versions did not include a User-agent: in the request.

Best regards,
Ken