PHP Script to Display Your Wunderground Historical Data

I have created a PHP script that displays a station’s Wunderground historical data in a fashion similar to how they do. It reads and displays the CSV data that is available and also shows the charts that have been mentioned in other threads. You can view demos, see a couple sites utilizing it, and download WU-History.zip by visiting http://jcweather.us/scripts.php .

Please let me know if you have any trouble or see need for improvement. Also please let me know if you decide to utilize the script so I can place a link on the scripts page.

As mentioned on that page, many thanks to Tom Chaplin, Ken True and Kevin Reed for the code that they’ve made available over the years. Also thanks to Henrik (JWWD) for his ideas and thorough testing.

Wow, great script, i will try this out tomorrow, thank you very much :slight_smile:

I decided to install it tonight here http://www.northantsweather.com/wx35.html
Problem is its too big for the page size i normally use, any ideas how i can change the
width to say 10% less please?

btw, excellent work, thanks

Bashy,

That’s just the result of the space you give it … it’ll use whatever is there. There’s a lot of data, so you may want to make metric your default rather than displaying both. Another option is to reduce the font size near the top of the .css file.

  • Jim

Very Nice Jim…Thanks for sharing this and also the other Scripts you have Provided in the Past.

I will probabbly give it a try later tonight…Chris

Cheers Jim, now changed to just Metric, i hate kmh but also hat Fahrenheit also so i cant win lol
As for the font, i cannot actually find the right one in in the css file, i think i must be tired :oops:
Time for bed me thinks…thanks again Jim, appreciated m8 :slight_smile:

Jim,

Really nice, it looks like a lot of effort went into this script, that’s a lot of code!!! 8O

I have it working here…http://www.branfordfire.com/weather/wu.php It takes a few secs to load but I’m sure it is because of the amount of data it is parsing. Thanks so much for sharing!

Regards,

Jack

Thanks Jack, it was a labor of love. Not! Every time I turned around there was more to do. I sure did learn a lot in the process though. The script is really quite quick, but you’re totally dependent upon the Wunderground response time to requests for data. Usually pretty decent though.

  • Jim

It looks like it isn’t finding your wuicons folder though. The background graphics are missing.

It looks like it isn't finding your wuicons folder though. The background graphics are missing.

:oops: Oops forgot to upload that file! #-o

Thanks!

Jack

Jack,…

I just went to your page and it loaded in less than 3 seconds here…must have been slowed down earlier because of the missing icon’s, but appear’s to loading fine now.

Nice Job…Looks good…and you beat me to it…LOL

…Chris

Got it working here…

http://www.gateway2capecod.com/wu.php

Thanks Jim I appreciate your Work.

…Chris

Very good job. weatherforyou.com/HAMweather also has archived historical data going back to around 2002. I contracted with someone to write an interface for it, which will be available in about a month. But we’d very much appreciate any volunteer help such as this and would gladly acknowledge it since we don’t exactly have the resources of WU.

Gosh - that’s fantastic! I see I have some work to do but I may get that sorted for another page of data. Yes! And all done by private folks for themselves and others to access their own station’s data, albeit just stored on WU.

Firewall, how on earth did you manage to make your font smaller?

I tried changing the font in this section /* Basic Setup and commonly used elements */
but didnt work #-o

The daily part is the issue, if you click weekly, monthly or yearly its fine, its just the Daily tab :frowning:

Excellent work…many thanks for sharing it with us…I have it working within my experimental website…yippee :slight_smile: :slight_smile:

There is a bad link to Wunderground that slipped by me … test, test, and you still miss something. If you’ll search for

<td><?php echo $Lthanks . ' '; ?><a href="/about/background.asp"> Weather Underground</a></td>

and replace it with

<td><?php echo $Lthanks . ' '; ?><a href="http://www.wunderground.com"> Weather Underground</a></td>

that will fix it up. Thanks to Jozef (Pinto) for finding this and letting me know. The download .zip file has been updated.

  • Jim
Firewall, how on earth did you manage to make your font smaller?

Bashy, it is just my normal table setting etc. I really did not change anything.

Chris…Looks good and you are right it loads very quickly now, must have been a traffic jam on the “internet tubes” last night!

Regards,

Jack

Hi Jim,

What a great script, and already incorporated on my site http://www.sandhurstweather.org.uk/wx10.php. As I say many times, thanks to all you very talented people out there who are willing to share your hard work with others that are less talented.

Cheers,
Ian

Bashy,

Can you try to change your font size here which is above the section you refer to?

#wuwrap { background-color: #EEE; color: #000; font-size: 11px; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; margin-top: 0px; margin-left: 0px; margin-right: 0px; text-align: left;}

  • Jim

Henrik (jwwd) asked if it would be possible to select other stations that may be of interest. I’ve added that capability as an option and it’s kind of growing on me. The .zip has been updated and the changed script is attached. To see it in action view the demos at

http://jcweather.us/scripts.php?mitem=130

It’s really nice to see that so many folks are finding this useful … much more satisfying that just seeing it on my site.

Thanks! - Jim


WU-History.php.txt (49.6 KB)