cloudy cloudy

Author Topic: advforecast.php script (Tom's)?  (Read 14831 times)

0 Members and 1 Guest are viewing this topic.

Offline 2-Wheeler

  • Posts: 196
  • 48 13 07.05 N, 122 41 11.84 W, Elevation: 95 ft
    • CoupevilleWeather
advforecast.php script (Tom's)?
« on: April 06, 2006, 03:53:01 AM »
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
« Last Edit: June 30, 2006, 12:30:03 PM by 2-Wheeler »

-David Broberg   CWOP#: CW5670 / CoCoRaHS #CO-BO-218

Offline saratogaWX

  • Global Moderator
  • Posts: 5,945
  • Ken True
  • Saratoga, CA, USA 37:16:28N, 122:01:23W - Elev: 374ft.
    • Saratoga Weather
Re: advforecast.php script (Tom's)?
« Reply #1 on: April 06, 2006, 04:41:01 AM »
I did a quick test on your URL, and found:
Code: [Select]
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
Ken True
Saratoga Weather
CWOP: CW1792
WeatherUnderground: KCASARAT1
Free weather website PHP scripts and WD website AJAX templates

Offline 2-Wheeler

  • Posts: 196
  • 48 13 07.05 N, 122 41 11.84 W, Elevation: 95 ft
    • CoupevilleWeather
Re: advforecast.php script (Tom's)?
« Reply #2 on: April 06, 2006, 03:00:02 PM »

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


Best regards,
Ken

Thanks Ken, that's what I needed.

-David Broberg   CWOP#: CW5670 / CoCoRaHS #CO-BO-218

Offline 2-Wheeler

  • Posts: 196
  • 48 13 07.05 N, 122 41 11.84 W, Elevation: 95 ft
    • CoupevilleWeather
Re: advforecast.php script (Tom's)?
« Reply #3 on: April 17, 2006, 04:15:25 AM »
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?
« Last Edit: June 30, 2006, 12:28:28 PM by 2-Wheeler »

-David Broberg   CWOP#: CW5670 / CoCoRaHS #CO-BO-218

Offline carterlake

  • Tom Chaplin
  • Posts: 2,273
  • Carter Lake, Iowa USA
    • Carter Lake, Iowa Weather
Re: advforecast.php script (Tom's)?
« Reply #4 on: April 17, 2006, 12:01:39 PM »
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://brobergs.us/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.
« Last Edit: April 17, 2006, 12:04:58 PM by carterlake »

WD; Davis VP2 6153; Quickcam for Notebooks Pro; Boltek w/ Nexstorm; GRLevel3; Live NOAA radio

Offline 2-Wheeler

  • Posts: 196
  • 48 13 07.05 N, 122 41 11.84 W, Elevation: 95 ft
    • CoupevilleWeather
Re: advforecast.php script (Tom's)?
« Reply #5 on: April 17, 2006, 03:44:16 PM »

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

-David Broberg   CWOP#: CW5670 / CoCoRaHS #CO-BO-218

Offline carterlake

  • Tom Chaplin
  • Posts: 2,273
  • Carter Lake, Iowa USA
    • Carter Lake, Iowa Weather
Re: advforecast.php script (Tom's)?
« Reply #6 on: April 17, 2006, 04:11:10 PM »
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.

WD; Davis VP2 6153; Quickcam for Notebooks Pro; Boltek w/ Nexstorm; GRLevel3; Live NOAA radio

Offline 2-Wheeler

  • Posts: 196
  • 48 13 07.05 N, 122 41 11.84 W, Elevation: 95 ft
    • CoupevilleWeather
Re: advforecast.php script (Tom's)?
« Reply #7 on: April 18, 2006, 12:11:20 AM »
Thanks! That did it. Seems to be working now, so I'll start playing with the templates - fun...

-David Broberg   CWOP#: CW5670 / CoCoRaHS #CO-BO-218

Offline 2-Wheeler

  • Posts: 196
  • 48 13 07.05 N, 122 41 11.84 W, Elevation: 95 ft
    • CoupevilleWeather
Re: advforecast.php script (Tom's)?
« Reply #8 on: June 30, 2006, 12:38:44 PM »
Well, it was working, but recently it stopped again.  :(

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.)
« Last Edit: June 30, 2006, 12:40:25 PM by 2-Wheeler »

-David Broberg   CWOP#: CW5670 / CoCoRaHS #CO-BO-218

Offline TechScribe

  • Posts: 45
  • Davis Weather Vue
  • Kirkland, Washington USA
    • KirklandWeather.com
Re: advforecast.php script (Tom's)?
« Reply #9 on: July 04, 2006, 08:54:06 AM »
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.

Offline carterlake

  • Tom Chaplin
  • Posts: 2,273
  • Carter Lake, Iowa USA
    • Carter Lake, Iowa Weather
Re: advforecast.php script (Tom's)?
« Reply #10 on: July 04, 2006, 12:41:39 PM »
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: http://saratoga-weather.org/scripts.php

WD; Davis VP2 6153; Quickcam for Notebooks Pro; Boltek w/ Nexstorm; GRLevel3; Live NOAA radio

Offline carterlake

  • Tom Chaplin
  • Posts: 2,273
  • Carter Lake, Iowa USA
    • Carter Lake, Iowa Weather
Re: advforecast.php script (Tom's)?
« Reply #11 on: July 04, 2006, 12:45:33 PM »
Hey David,

This thread seems to have been buried...

Your script doesn't seem to be pointed a tthe right URL again.
« Last Edit: July 04, 2006, 12:49:49 PM by carterlake »

WD; Davis VP2 6153; Quickcam for Notebooks Pro; Boltek w/ Nexstorm; GRLevel3; Live NOAA radio

Offline saratogaWX

  • Global Moderator
  • Posts: 5,945
  • Ken True
  • Saratoga, CA, USA 37:16:28N, 122:01:23W - Elev: 374ft.
    • Saratoga Weather
Re: advforecast.php script (Tom's)?
« Reply #12 on: July 04, 2006, 02:38:26 PM »
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 :-) , 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
Ken True
Saratoga Weather
CWOP: CW1792
WeatherUnderground: KCASARAT1
Free weather website PHP scripts and WD website AJAX templates

Offline TechScribe

  • Posts: 45
  • Davis Weather Vue
  • Kirkland, Washington USA
    • KirklandWeather.com
Re: advforecast.php script (Tom's)?
« Reply #13 on: July 04, 2006, 10:06:18 PM »
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?

Offline carterlake

  • Tom Chaplin
  • Posts: 2,273
  • Carter Lake, Iowa USA
    • Carter Lake, Iowa Weather
Re: advforecast.php script (Tom's)?
« Reply #14 on: July 04, 2006, 11:51:40 PM »
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:

WD; Davis VP2 6153; Quickcam for Notebooks Pro; Boltek w/ Nexstorm; GRLevel3; Live NOAA radio

 

cumulus