advforecast.php script (Tom's)?

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

Hi Ken,

Thanks for the response. I think that is the URL that I used. In Tom’s Advanced forecast ( http://www.carterlake.org/advforecast.php.txt), I replaced Tom’s URL ($fileName =) with that identical URL. I’m not sure what it is that I’m doing wrong.

Thanks,

Mike

Mike:
I think the URL you used was just slightly different, as the contents of your cache file showed the parent page of the printable point forecast, not the printable point forecast itself.

Please try copy from the URL in the prior post and paste into the $filename part of the script. I’d checked the URL in the above post in a browser window, and it does yield the printable point forecast. :slight_smile:

Best regards,
Ken

Thanks Ken, I will give this a shot when I get home. (Still at work) I will let you know how it turns out. I appreciate your help.

Mike

Ken,

It worked!!! Thanks for the help!!

Mike

You’re welcome Mike. The trick to seeing if you have the right URL is to go to the webpage on the NOAA website, and if you don’t see JUST the row of icons and the text description of conditions, find the link that says Printable Forecast at the bottom-right of the page and click it… it should show a page with the icons and text descriptions of the forecast only… copy that url and use it with Tom’s forecast script.

Best regards,
Ken

Well I am thinking about embedding this onto my forecast page (http://www.chucksndweather.info/wx.html). I was wondering if this is the right url I have to use. Plus where do you put the folders for the icons on your webserver or your computer. I am a bit confused about this. I like the way it looks. Any help would be greatly appreciated. I am very much a beginner at this.

http://www.crh.noaa.gov/forecast/MapClick.php?FcstType=text&textField1=48.154744525547&textField2=-101.21288135593&site=bis&TextType=2

Chuck

I still haven’t sorted things out. :oops:

It just stopped working but everything looks right. Can anyone help?

My forecast.txt file is old and hasn’t updated since July 7…
http://www.leyner.org/forecast.txt Why?

But nothing but blanks shows up on the forecast page (probably because the data is old?):
http://www.leyner.org/my-advforecast.php

The printable point forecast works by itself and has been working before:
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

Any ideas?

Thanks,
David

Hi David,

You have some very weird web configuration there…

Your forecast text is not located at: http://www.leyner.org/forecast.txt

It is located here: http://www.brobergs.us/Weather/forecast.txt

Your PHP script is not located here: http://www.leyner.org/my-advforecast.php

It is located here: http://www.brobergs.us/Weather/my-advforecast.php

You probably have the script configured for where you think it is located… not where it’s really located.

Yes, it’s a bit wierd, but they both point to the same place and the same files. But I’m not sure it matters, but I’ll take a look in the script and see if there is something I can change with the file locations that will make a difference. Thanks.