My app is working again with these changes. Good luck!
.. could you share a little more info about how you modified the original?
Thanks,
Dennis
Script I posted (JSON_generator.php) is not a rewrite of the scripts written by ELDoradoWx. His JavaScript scripts (see
http://www.eldoradocountyweather.com/scripts/radar-on-google-maps.txt) make an AJAX call to JSON_generator.php on the
www.srh.noaa.gov site. You pass it a parameter that says how many frames you want, and it returns the file names for those images, which are then plugged into <img> elements on your site and displayed.
The version on
www.srh.noaa.gov stopped working, but you could still look at the file names manually. For example, to see a directory listing for the current NCR images for station ATX, just look at
http://radar.weather.gov/ridge/RadarImg/NCR/ATX/ from your browser.
So what I did was write a server-side (PHP) program that accessed that URL. It takes the HTML of the directory listing that comes back and scrapes (parses) it to get the file names and returns them. So it gives the same result as the JSON_generator.php on
www.srh.noaa.gov, but it works completely differently (I think, since I don't have the source of NOAA's version of JSON_generator.php). The only other difference is that it returns the files on the radar.weather.gov site, which seems to be more stable than the
www.srh.noaa.gov site.
So if you are using one of ELDoradoWx's scripts on your site, what you need to do is the following. It is pretty simple actually:
1) Install my new JSON_generator.php program (and EasyWebFetch.php) on your site somewhere so you can call it. Let's say your site is "mysite.com" and you put these files in the directory "myradar".
2) Edit the script from ELDoradoWx and change any line similar to this:
var stub="
http://www.srh.noaa.gov/ridge2/JSON_generator.php?callback=CallBack&frames="+Wrap;
to instead call the script on your site like this:
var stub="
http://mysite.com/myradar/JSON_generator.php?callback=CallBack&frames="+Wrap;
The important part is to change the URL to access JSON_generator.php on your site instead of the non-working version on the NOAA site.
3) Also edit the script so that it accesses the image files on radar.weather.gov instead of
www.srh.noaa.govFor example, in the function "CallBack" the first line is:
var stub="
http://www.srh.noaa.gov/";
Change that to
var stub="
http://radar.weather.gov/";
In summary, drop two files on your server, edit two lines in ELDoradoWx's script. Now everything should work again.
If the NOAA website is working again, that's great, but you still might want to make these changes, since radar.weather.gov seems to be both faster and more stable than the NOAA site.
To answer DaculaWeather, my JSON_generator.php program only fetches one station at a time, exactly the same as NOAA's JSON_generator.php program. ELDoradoWx's script calls this multiple times if you want to display more than one weather station. It works exactly the same as before.