Station Historical Data

My weather page has an issue displaying the Station Historical Data.
http://www.vancamweather.com/wxwuhistory.php
The graphs are correct but, the chart data is incorrect and I am not sure what is causing the issue.
Any helped is appreciated.
Larry

The graphs are correct as they are loaded as an image directly from the WU servers, no processing at all in the script.

The strange tables are caused by another change in WU. This script from Jim McMurry uses socket connections to read the data from WU.
Until a few days ago there were 11 lines of extra data (=garbage, headers) before the real data started. Now there are dozens more and the script process the garbage as data.
The not needed lines are skipped in function getcsvWithoutHanging lines 1283-1285. You could up the number from 11 to 30 but as long as there is no exact number known you may loose valid data also.

I attach a modified version which uses CURL to load the data.
At friends sites this solved the problem, BUT ALWAYS make a copy of the script you are going to replace.
When the WU-problem disappears, you can go back to the normal script as supported by Ken / Jim.

Wim


WU-History-inc.php.zip (15.1 KB)

Thank you.
I will give it a try.
Larry

Thanks Wim, it worked for me.

Thanks Wim. Solved my problem.
Love your city!
Larry

http://www.vancamweather.com