advforecast.php script (Tom's)?

I’m just starting to try out some of these scripts, but seem to be having some trouble (what’s new).

Anyway, I think I’ve done it as described in the remarks, including a forecast.txt file in my main folder, then adding the new folders: ifps/text/images. Then I used the printable forecast link for my area, but when I try to access that page, I get the pop-up that asks me if I want to OPEN or SAVE the file. If I put your file in without any changes (exept removing the .txt extension, then I get the same thing.

What am I overlooking?
The unmodified file is here: http://brobergfamily.com/weather/advforecast.php

My version is here: http://brobergs.us/Weather/my-advforecast.php

Text file is here: http://brobergs.us/Weather/forecast.txt

Thanks,
David

I did a quick test on your URL, and found:


GET /weather/my-advforecast.php HTTP/1.1
Host: brobergs.us
Connection: close
User-Agent: Sam Spade 1.14

HTTP/1.1 200 OK
Server: Microsoft-IIS/5.1
Connection: close
Date: Thu, 06 Apr 2006 04:31:36 GMT
Content-Type: application/octet-stream
Accept-Ranges: bytes
Last-Modified: Thu, 06 Apr 2006 00:49:34 GMT
ETag: "92e1eaf81359c61:a23"
Content-Length: 7182

<?php 
 ....

That just indicates that PHP is not currently available on your webserver – it just tries to download the script (but not execute it).

If you are running your own Microsoft server, you’ll have to install PHP on it to get Tom’s script to work. For instructions/download of PHP see: http://www.php.net/downloads.php

If you are using an ISP hoster, then you may be out of luck, as it appears that PHP is not available with your service offering, but you could ask them for the service.

Best regards,
Ken

Thanks Ken, that’s what I needed.

Okay, I’ve loaded the PHP on my server and gave it another try. The first time I loaded the advforecast.php page, it worked, but the graphic links were broken. I fixed the graphic links and reloaded and everything was great.

But, this was the original file from Tom’s script and didn’t show my local forecast. So next I tried to view my-advforecast.php and it loaded, but most of the page was blank -no details. I figured maybe my link was bad to the NWS forecast.

But when I went back to check Tom’s original script again, it did the same thing - all blank. Now I’m puzzled, I got it working once, but now it seems something else is wrong.

Here is the original file: http://brobergfamily.com/weather/advforecast.php

And my modified version: http://brobergs.us/Weather/my-advforecast.php

Any suggestions?

http://brobergs.us/weather/forecast.txt

This is not a point, printable forecast, but this is:

http://www.crh.noaa.gov/ifps/MapClick.php?FcstType=text&textField1=40.0715713500977&textField2=-105.1665420532227&site=den&Radius=0&CiTemplate=0&TextType=2

You’re caching the wrong URL.

Thanks Tom. Sorry I’m still struggling a bit here. Your link looks very similar to mine, but coordinates and elevation are slightly off. I was trying to “zero-in” on a closer “Point”. When I compare this URL to yours, both pages say “Point Forecast”, just the data is slightly different. Can I use this location?
http://www.crh.noaa.gov/ifps/MapClick.php?FcstType=text&textField1=40.048237&textField2=-105.103348&site=den&Radius=0&CiTemplate=0&TextType=2

The only difference I can see is in the longitude and latitude. Do I need more decimal places if the link works on its own?

What was supposed to be in the forecast.txt file?
I’m still puzzled why your original template was working fine, and now it doesn’t.

-David

Any point forecast will work.

The reason it isn’t working is because your cached version is -NOT- a point forecast. You need to change the URL. Once the script grabs a correct point forecast, it will begin working again and should work correctly from now on.

The difference between the regular and the advanced is the caching and better error handling. These not only reduce load on NOAA but reduce the chances of downtime.

Thanks! That did it. Seems to be working now, so I’ll start playing with the templates - fun…

Well, it was working, but recently it stopped again. :frowning:

The link to the point forecast seems to still work:
http://www.crh.noaa.gov/ifps/MapClick.php?FcstType=text&textField1=40.048237&textField2=-105.103348&site=den&Radius=0&CiTemplate=0&TextType=2e=2

But when the php page opens, all it shows is blanks.

Even the unmodified php shows blanks now. Any ideas?
(I updated the links in the above thread, so they should be accurate again.)

I’m taking the plunge to move to PHP and I’m running into the same thing (blank data, just colons). I’d love to hear the solution.

Sorry but Washington State doesn’t have point, printable forecasts that the script keys off of…

Ken has a modified script which may work for you: Saratoga-Weather.org - Scripts

Hey David,

This thread seems to have been buried…

Your script doesn’t seem to be pointed a tthe right URL again.

David:

Your script output shows blanks again, and it may be because your hoster (or www.crh.noaa.gov) have blocked access from your website server’s IP address.

You can fix this by reporting to your webhoster that www.crh.noaa.gov can’t be accessed from your webserver, or you can do what I did … have WD fetch the point forecast URL and save it as ‘forecast.txt’ and upload it to the same directory as your forecast PHP script resides. I do this on 15 minute intervals so the caching part of the script always finds a ‘fresh cache’ and never trys to access the www.crh.noaa.gov site itself.

Beeker425:

Tom is right… The NWS Western Region (www.wrh.noaa.gov) has a different website format than the rest of the NWS websites, so the advforecast script won’t display the Icons and text. For folks in (CA, NV, AZ, UT, ID, MT, OR, WA), the WRH NWS script ( http://saratoga-weather.org/scripts.php#nwsPHP ) works fine. As a bonus :slight_smile: , the WRH NWS script combines PoP with the Icons (like the rest of the NWS sites). The same caveat (getting a blank forecast) that I talked about above applies… Using WD to fetch the URL and preload the cache (wrh-forecast.txt) is the only way the script works for me, as either the wrh.noaa.gov or 1and1 is blocking access from my webserver.

Best regards,
Ken

OK, I’m not getting it.

You say “For folks in (CA, NV, AZ, UT, ID, MT, OR, WA), the WRH NWS script ( http://saratoga-weather.org/scripts.php#nwsPHP ) works fine.”

Yet someone else is saying Washington doesn’t have a page.

Which is it?

I stated that WA doesn’t have a point, printable forecast. You’ll need to use the script that Ken posted, which you also posted, and I also posted (twice now). :roll:

In other words Tom’s script is good for the rest of the country, but us folks in the west have to use Ken’s script.

niko

Yes, in fact the URL and much more seem to be MIA from the script altogether. Somehow FrontPage must have screwed it up again. I’ll have to rebuild it again. Thanks.

Thanks Ken. Turns out it was something else. I do the same as you and actually have a mirror site that was doing the same thing. The main site and the mirror are on two different servers and two different hosts. The script itself is hosed and I’ll have to rebuild it.

I’ve just attempted to set mine up. Can someone shed some light on what I may be doing wrong?

http://69.143.144.53/forecast.php

http://69.143.144.53/forecast.txt

Thanks,
Michael

Sure, you need the printable point forecast (you selected the URL from the first map click)… Here’s the URL you need (based on what’s in your cache file forecast.txt)

http://www.erh.noaa.gov/ifps/MapClick.php?FcstType=text&textField1=39.2156448364258&textField2=-76.7381134033203&site=lwx&Radius=0&CiTemplate=0&TextType=2

Best regards,
Ken