cloudy

Author Topic: River/Lake Height Display addon page for WD-AJAX-PHP-USA  (Read 11576 times)

0 Members and 1 Guest are viewing this topic.

Offline clappy9

  • Posts: 205
  • Masonville, NY
    • East Masonville Weather
River/Lake Height Display addon page for WD-AJAX-PHP-USA
« on: August 29, 2010, 06:22:40 PM »
This script will display your local data from the Advanced Hydrologic Prediction Service. Wxriverpage.php will give viewers an overall summary of local river/lake heights. Wxriverdetail.php will give a detailed look at a gauge, showing records, stages of flood, forecast, and recent observations.

Features:
  • Variable Display depending on what data is given
  • Colors changes with the stage.
  • Select amount of data shown.
  • Select scale on gauge images.
  • Clickable map for gauges.
  • Option to choose location of images.


Version 2.15 - 28-Sept-2011 - Fixed clickable map, AHPS made a few more changes, causing the clickable map to not function properly.
Version 2.14 - 08-Sept-2011 - Fixed detail page so forecast shows up properly. Also summary page was fixed to show record flooding.
Version 2.13 - 11-May-2011 - Fixed a few Not Defined river errors. Also fixed stage/flow colors for certain conditions.   
Version 2.12 - 21-Feb-2011 - Fix for name of river on details page.  Changed names to AHPS standards. Added dropdown menu for details page.
Version 2.11 - 01-Jan-2011 - Fix for the clickable map.  Now works with how the AHPS is doing the xml.
Version 2.10 - 20-Nov-2010 - Status of the Gauge will now show for those with rivers with only flow readings and flow records. All shorttags have been replaced with the full php tag.
Version 2.01 - 20-Sept-2010 - Fixed Clickable map so it will now work with lowercase gauge id's. Fixed "Not Defined" error on gauges without an action stage. Also fixed other cosmetic issues.
Version 2.00 - 18-Sept-2010 - Big changes, Clickable map- Thanks to Jim, also added the ability to put the images at the top or the bottom of the page. Hopefully fixed the script for the newest version of PHP.
Version 1.02 - 12-Sept-2010 - Added "Back to River Summary" on detail pages. Also other minor fixes.
Version 1.01 - 29-Aug-2010 - Fixed Not Defined Status on gauges without an action stage. Also fixes Negative flow, now displayed as N/A.
Version 1.00 - 29-Aug-2010 - Initial Release.

See it in action - http://eastmasonvilleweather.com/wxriverpage.php

Download - http://eastmasonvilleweather.com/downloads/wxriver.zip

Check for Updates - http://eastmasonvilleweather.com/downloads.php
« Last Edit: September 28, 2011, 06:45:56 PM by clappy9 »
East Masonville Weather
Upstate New York
http://eastmasonvilleweather.com


Offline ALITTLEweird1

  • Mark
  • Posts: 3,984
  • Snoqualmie,WA
    • Snoqualmie Weather
Re: River/Lake Height Display addon page for WD-AJAX-PHP-USA
« Reply #1 on: August 29, 2010, 06:59:48 PM »
Nice script.. Thanks for sharing it..

http://www.snoqualmieweather.com/wxriverpage.php
"Nature can do without man, but man cannot do without nature."

Davis VP2 + 1-Wire Solar + 1-wire Lightning + 1-Wire UV + Logitech Webcam

Offline ALITTLEweird1

  • Mark
  • Posts: 3,984
  • Snoqualmie,WA
    • Snoqualmie Weather
Re: River/Lake Height Display addon page for WD-AJAX-PHP-USA
« Reply #2 on: August 29, 2010, 07:21:55 PM »
In this line in the config file, I had to change & to & so it would validate..

$currentstage = "http://water.weather.gov/ahps2/all_layer_merge.php?wfo=sew&layers=10,7,8,2,9,15,6";

"Nature can do without man, but man cannot do without nature."

Davis VP2 + 1-Wire Solar + 1-wire Lightning + 1-Wire UV + Logitech Webcam

Offline clappy9

  • Posts: 205
  • Masonville, NY
    • East Masonville Weather
Re: River/Lake Height Display addon page for WD-AJAX-PHP-USA
« Reply #3 on: August 29, 2010, 07:31:35 PM »
I just noticed that I released an older version.

Version 1.01 - Aug-29-2010 - Fixed Not Defined Status on gauges without an action stage. Also fixes Negative flow, now displayed as N/A.

and this version validates.  Sorry about this guys.

Download at beginning of thread.

-Dennis
« Last Edit: August 29, 2010, 07:34:02 PM by clappy9 »
East Masonville Weather
Upstate New York
http://eastmasonvilleweather.com


Offline sacreysouthern

  • Posts: 202
  • Saline Weather
  • Benton/Salem, AR, USA
    • Saline Weather
Re: River/Lake Height Display addon page for WD-AJAX-PHP-USA
« Reply #4 on: August 29, 2010, 07:50:37 PM »
Cool script Dennis.  Thanks for sharing.
John Sacrey, Saline Weather on Twitter

GR2AE, GR3, CWOP/WU ID: D2073

Offline drobbins

  • Posts: 1,615
  • Kentucky, USA
    • Cave Country Weather
Re: River/Lake Height Display addon page for WD-AJAX-PHP-USA
« Reply #5 on: August 29, 2010, 08:29:42 PM »
Ok.. What did I do wrong?  :oops:
http://www.cavecountryweather.com/wxriverpage.php


Edit:
Got it now. I had to manually create the river-XXXX2.txt files and set the permissions.

Edit #2:
I merged your script with a clickable map I already had and added some wording at the bottom. Thanks for the great script!
http://www.cavecountryweather.com/riverlevel.php
« Last Edit: August 30, 2010, 01:06:17 AM by drobbins »

Offline lddaly

  • Plano, Texas - USA
  • Posts: 108
  • Plano, TX - USA
    • Plano, TX Weather
Re: River/Lake Height Display addon page for WD-AJAX-PHP-USA
« Reply #6 on: August 30, 2010, 02:01:30 AM »
#-o The river-xxxx2.txt files are almost 200KB each. 8O Keep that in mind with your fetch frequency and the number of gauges you are using.

Offline clappy9

  • Posts: 205
  • Masonville, NY
    • East Masonville Weather
Re: River/Lake Height Display addon page for WD-AJAX-PHP-USA
« Reply #7 on: August 30, 2010, 03:01:08 AM »
Yeah these files are big, I have plans to change this so it does not use as much bandwidth.  But classes start this week so this will have to do for the time being.

Drobbins, I like the click able map, nice addition.

-Dennis
East Masonville Weather
Upstate New York
http://eastmasonvilleweather.com


warwickpaweather

  • Guest
Re: River/Lake Height Display addon page for WD-AJAX-PHP-USA
« Reply #8 on: August 30, 2010, 09:47:38 AM »
Good Monday morning......I've set it all up per the instructions but am getting this...


Warning: simplexml_load_file() [function.simplexml-load-file]: I/O warning : failed to load external entity "./River/river-.txt" in /virtual/users/e16478-17699/web/wxriverdetail.php on line 50





 

Offline drobbins

  • Posts: 1,615
  • Kentucky, USA
    • Cave Country Weather
Re: River/Lake Height Display addon page for WD-AJAX-PHP-USA
« Reply #9 on: August 30, 2010, 10:19:09 AM »
Chris,
It is looking for a file for each of you locations. Use notepad and just create blank files named river-XXXXX.txt. Replace the XXXXX with the gauge name (ALBK2 or whatever) then upload the files in to the River folder. File permissions should be set to 666.

warwickpaweather

  • Guest
Re: River/Lake Height Display addon page for WD-AJAX-PHP-USA
« Reply #10 on: August 30, 2010, 10:32:43 AM »
Perfect...thats what I had thought but EACH time I think, I weaken society.!

Also, now I get an error saying curl statement on line 10 in river-fetch.php is invalid.......  can I use Windows Scheduler to run the fetch file???

thanks again.
« Last Edit: August 30, 2010, 10:44:06 AM by ChrisinPA »

Offline clappy9

  • Posts: 205
  • Masonville, NY
    • East Masonville Weather
Re: River/Lake Height Display addon page for WD-AJAX-PHP-USA
« Reply #11 on: August 30, 2010, 10:51:44 AM »
Yeah you can use Windows Scheduler. It just needs to call that file to download the information.

-Dennis
East Masonville Weather
Upstate New York
http://eastmasonvilleweather.com


Offline CNYWeather

  • Professional Trophymaker!
  • Posts: 1,440
  • Rome, New York
    • CNYWeather.com
Re: River/Lake Height Display addon page for WD-AJAX-PHP-USA
« Reply #12 on: August 30, 2010, 12:05:19 PM »
Thanks again Dennis!!!

A suggestion. A back button to the main river page when viewing a river detail page,
a link back to the main river page.  Other than that, perfect!

Tony  8)
Tony

CNYWeather.com
CWOP: CW2352
WeatherUnderground: KNYWESTM1


http://www.CNYWeather.com

I Make Trophies Too!
http://www.speedyawards.com

Offline fhweather

  • Posts: 14
    • foresthillweather.com
Re: River/Lake Height Display addon page for WD-AJAX-PHP-USA
« Reply #13 on: September 12, 2010, 02:14:41 PM »
Can anybody tell me what I did wrong.  http://www.foresthillweather.com/wxriverpageB.php
I am not running it in a cron job in tell I get the script to work.


Thanks Scott

Offline clappy9

  • Posts: 205
  • Masonville, NY
    • East Masonville Weather
Re: River/Lake Height Display addon page for WD-AJAX-PHP-USA
« Reply #14 on: September 12, 2010, 02:49:40 PM »
Hi Scott,

Right now I am not really sure what is up. I ran one of your gauges with my page and it worked fine.  PM me your pages and I will take a look to see what is up.

-Dennis
East Masonville Weather
Upstate New York
http://eastmasonvilleweather.com