Author Topic: PHP Script to Display Your Wunderground Historical Data  (Read 26505 times)

0 Members and 1 Guest are viewing this topic.

Offline jmcmurry

  • Jim McMurry
  • Forecaster
  • *****
  • Posts: 472
  • Davis Vantage Pro 2 Plus Wireless.
    • Juneau County Weather
PHP Script to Display Your Wunderground Historical Data
« on: February 18, 2008, 05:50:53 PM »
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.

Forum Search and Google Can be Your Best Friends

Offline BfdWx

  • WxElement panel
  • Senior Contributor
  • *****
  • Posts: 229
    • http://southernctwx.com
Re: PHP Script to Display Your Wunderground Historical Data
« Reply #1 on: February 18, 2008, 07:43:40 PM »
Jim has put an incredible amount of work on this script and it is an excellent historical reference for your site. Nice work Jim and thanks for sharing! =D>

I have the script running here...http://www.branfordfire.com/weather/wu.php if you would like to see another example.

Regards,

Jack

Offline dnicho77

  • Member
  • *
  • Posts: 2
    • Puget Sound Weather
Re: PHP Script to Display Your Wunderground Historical Data
« Reply #2 on: February 18, 2008, 09:13:27 PM »
 :grin: Excellent work! I have it running here http://www.southsoundweather.com/WUHistory.php

Working on the spacing to match my website templates

Thanks
Dale

Offline weatherforyou

  • Forecaster
  • *****
  • Posts: 509
  • My weather is on WeatherForYou.com. Is yours?
    • http://www.weatherforyou.com
Re: PHP Script to Display Your Wunderground Historical Data
« Reply #3 on: February 19, 2008, 12:47:32 AM »
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.  :)
Joe Torsitano


Offline anchorageweather

  • Forecaster
  • *****
  • Posts: 445
    • http://eetee.us/station/station.php
Re: PHP Script to Display Your Wunderground Historical Data
« Reply #4 on: February 19, 2008, 02:23:15 AM »
Wow, thats GREAT!!!  Looks like I've got something to do this weekend!
South of the Tracks, Anchorage, KY

Offline jmcmurry

  • Jim McMurry
  • Forecaster
  • *****
  • Posts: 472
  • Davis Vantage Pro 2 Plus Wireless.
    • Juneau County Weather
A minor Change
« Reply #5 on: February 19, 2008, 07:28:02 AM »
There is a bad link to Wunderground that slipped by me ... test, test, and you still miss something.  If you'll search for

Code: [Select]
<td><?php echo $Lthanks ' '?><a href="/about/background.asp"> Weather Underground</a></td>
and replace it with

Code: [Select]
<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

Forum Search and Google Can be Your Best Friends

Offline jmcmurry

  • Jim McMurry
  • Forecaster
  • *****
  • Posts: 472
  • Davis Vantage Pro 2 Plus Wireless.
    • Juneau County Weather
A New Feature
« Reply #6 on: February 19, 2008, 02:45:19 PM »
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.  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

Forum Search and Google Can be Your Best Friends

Offline up10ad

  • USA Weather Finder
  • WxElement panel
  • Forecaster
  • *****
  • Posts: 572
  • Station will be back up someday...
    • Forecaster without a site
Re: PHP Script to Display Your Wunderground Historical Data
« Reply #7 on: February 19, 2008, 09:33:33 PM »
This is so nice I am tempted to turn off my VWSql and VWSphp since I mainly use them to display historical graphs.  Here is my page.
Rick (K6DYC)
Have you joined USAWeatherFinder.com yet?

Offline WeatherBeacon

  • Chief
  • Forecaster
  • *****
  • Posts: 1369
    • http://www.wxbeacon.com
Re: PHP Script to Display Your Wunderground Historical Data
« Reply #8 on: February 20, 2008, 01:24:34 PM »

That's really cool, Jim! Thanks!

I haven't added it to my site yet, but I hope to in the next month or so.

Kevin...
Mae govannen!
Kevin  (Member AMS) http://www.wxbeacon.com               Genesee County, Michigan
Hardware:  Davis Vantage Pro Wireless, Midland WR-300
Software: VWS 14.01p43, WeatherFlash, & GRLevel3

jwyman

  • Guest
Re: PHP Script to Display Your Wunderground Historical Data
« Reply #9 on: February 20, 2008, 03:06:01 PM »
Ok, Ok, i'm going to play devil's advocate here..   :evil: Don't shoot me, just yet.. lol.

Can someone explaing to me the benefits of doing this when most programs already have graphing capabilities and you also run the risk of multiple points of failure (i.e you not sending data to WU or WU being down).

BTW, nice work. Just trying to decide if I really want to include this.... OK. Now someone can sell me on the point!    :grin: :grin: :grin:

Jim

Offline BfdWx

  • WxElement panel
  • Senior Contributor
  • *****
  • Posts: 229
    • http://southernctwx.com
Re: PHP Script to Display Your Wunderground Historical Data
« Reply #10 on: February 20, 2008, 04:17:25 PM »
Quote
Just trying to decide if I really want to include this.... OK. Now someone can sell me on the point!

One stop shopping! Visitors to my site can see my WU data without leaving my site, plus they can check other area historical data and stay on my site. If the data is down for some reason it should be no big deal, if it's WU problem they will get it fixed if it'd WD's problem I'll know long before too much data is lost. I realize that most visitors to a weather web page are looking for something specific so I try to make a variety of areas that of interest to a broad audience, this is just one more page that may interest just one person! In fact just today I e-mailed one of the other hosters in my area and he was amazed at what the program was capable of. Now he can check his data from my site!

Offline WeatherBeacon

  • Chief
  • Forecaster
  • *****
  • Posts: 1369
    • http://www.wxbeacon.com
Re: PHP Script to Display Your Wunderground Historical Data
« Reply #11 on: February 20, 2008, 05:12:56 PM »

Ok, Ok, i'm going to play devil's advocate here..   :evil: Don't shoot me, just yet.. lol.

Can someone explaing to me the benefits of doing this when most programs already have graphing capabilities and you also run the risk of multiple points

Sure.

The main reasons I like this include:
  • This script makes the WU graphs part of my site without directing one of my visitors to another site. (I don't like having links that invite people to leave my site!)
  • It has built in date changing (day/week/month/year) without going to a different page. My current VWS graphs aren't nearly as flexible.

Secondary reasons include:
  • I like the WU graphs. I've seen better, but WU's graphs aren't bad.
  • I can't say I've been terribly fond of my VWS graphs for web presentation.
       Yeah... okay. I had to check. It's okay to say that on this forum. ;)

Regards,

Kevin...

p.s.  You're ever the devil's advocate, eh Jim? ;) O:)   I'll [-o&lt; for you. ;)
Mae govannen!
Kevin  (Member AMS) http://www.wxbeacon.com               Genesee County, Michigan
Hardware:  Davis Vantage Pro Wireless, Midland WR-300
Software: VWS 14.01p43, WeatherFlash, & GRLevel3

Offline WeatherBeacon

  • Chief
  • Forecaster
  • *****
  • Posts: 1369
    • http://www.wxbeacon.com
Re: PHP Script to Display Your Wunderground Historical Data
« Reply #12 on: February 20, 2008, 05:38:39 PM »

Forget waiting a month or two. :roll: I just added it to my site. Thanks, Jim! =D&gt;

Regards,

Kevin...
Mae govannen!
Kevin  (Member AMS) http://www.wxbeacon.com               Genesee County, Michigan
Hardware:  Davis Vantage Pro Wireless, Midland WR-300
Software: VWS 14.01p43, WeatherFlash, & GRLevel3

jwyman

  • Guest
Re: PHP Script to Display Your Wunderground Historical Data
« Reply #13 on: February 20, 2008, 06:37:36 PM »
Ok,Ok , so did I ! Very easy to do and man does it look nice! THanks Jim - From Jim  \:D/ \:D/ \:D/

Offline WeatherBeacon

  • Chief
  • Forecaster
  • *****
  • Posts: 1369
    • http://www.wxbeacon.com
Re: PHP Script to Display Your Wunderground Historical Data
« Reply #14 on: February 20, 2008, 07:15:53 PM »

Ok,Ok , so did I ! Very easy to do and man does it look nice! THanks Jim - From Jim  \:D/ \:D/ \:D/

He he he! :lol:
Mae govannen!
Kevin  (Member AMS) http://www.wxbeacon.com               Genesee County, Michigan
Hardware:  Davis Vantage Pro Wireless, Midland WR-300
Software: VWS 14.01p43, WeatherFlash, & GRLevel3

jwyman

  • Guest
Re: PHP Script to Display Your Wunderground Historical Data
« Reply #15 on: February 20, 2008, 08:53:15 PM »
BTW, if you'd like to see,  www.espwxctr.com/graphs.php

 \:D/

Jim

Offline BfdWx

  • WxElement panel
  • Senior Contributor
  • *****
  • Posts: 229
    • http://southernctwx.com
Re: PHP Script to Display Your Wunderground Historical Data
« Reply #16 on: February 20, 2008, 09:20:10 PM »
Jim,

You've got such a great looking site....you should give the link to the historical page, it really looks good "within" your site. Nice job!

Jack

jwyman

  • Guest
Re: PHP Script to Display Your Wunderground Historical Data
« Reply #17 on: February 20, 2008, 09:26:09 PM »
Thanks for hte very kind words.. There are so many people out there with super great ideas. It's just getting the feel of what your users would benefit from the most. That's what I love about this hobby/profession/advocation.....

Are you talking about the "On This Day" link?


Jim

Offline BfdWx

  • WxElement panel
  • Senior Contributor
  • *****
  • Posts: 229
    • http://southernctwx.com
Re: PHP Script to Display Your Wunderground Historical Data
« Reply #18 on: February 20, 2008, 09:42:49 PM »
Quote
Are you talking about the "On This Day" link?

No, it's just when I clicked on the link you posted it brought me to a stand alone page of the Historical data as opposed to the one "embedded" in your site....http://espwxctr.com/index.htm (under "historical>graphs").

Jack

Offline weatherforyou

  • Forecaster
  • *****
  • Posts: 509
  • My weather is on WeatherForYou.com. Is yours?
    • http://www.weatherforyou.com
Re: PHP Script to Display Your Wunderground Historical Data
« Reply #19 on: February 21, 2008, 02:52:59 AM »
Are you talking about the "On This Day" link?
I originally compiled that data about seven years ago and have been updating it recently with events after 1989.  It's available to any personal weather station site that wants to use it.  Of course a link back to weatherforyou.com from any site that uses it would be nice.   :?
Joe Torsitano


Offline jmcmurry

  • Jim McMurry
  • Forecaster
  • *****
  • Posts: 472
  • Davis Vantage Pro 2 Plus Wireless.
    • Juneau County Weather
Re: PHP Script to Display Your Wunderground Historical Data
« Reply #20 on: February 21, 2008, 06:55:06 AM »
Thanks to all for the kind words about the script.  It sure is gratifying to know that folks find it useful and that they've found no major problems with implementing it (so far).  My site was sadly lacking in the "historical data" department, so that was my motivation for the project.

I've added links to my scripts page for the folks who have posted above, but would very much like to hear from anyone else who is finding the script useful.  It makes me feel good.  If you'll either post a link here, PM or EMail me, I'll make those additions.

Thanks again.  - Jim

Forum Search and Google Can be Your Best Friends

Offline up10ad

  • USA Weather Finder
  • WxElement panel
  • Forecaster
  • *****
  • Posts: 572
  • Station will be back up someday...
    • Forecaster without a site
Re: PHP Script to Display Your Wunderground Historical Data
« Reply #21 on: February 21, 2008, 10:17:06 AM »
I originally compiled that data about seven years ago and have been updating it recently with events after 1989.  It's available to any personal weather station site that wants to use it.  Of course a link back to weatherforyou.com from any site that uses it would be nice.   :?
Joe,

I used to have a Today page but dropped it a while back because most of the data was really old.  Is there a link to the one you use on your pages with the search form?  I'd like to give it a look if you don't mind.

Thanks.
Rick (K6DYC)
Have you joined USAWeatherFinder.com yet?

Offline DaculaWeather

  • It's a Jeep thing... you wouldn't understand.
  • WxElement panel
  • Forecaster
  • *****
  • Posts: 3159
  • SCCA EM #156
    • North Georgia and US Weather
Re: PHP Script to Display Your Wunderground Historical Data
« Reply #22 on: February 21, 2008, 12:17:15 PM »
Jim, I'm using the script on my site and love it! Thanks a million!

jwyman

  • Guest
Re: PHP Script to Display Your Wunderground Historical Data
« Reply #23 on: February 21, 2008, 12:56:12 PM »
Hey bruecksteve,
  Did your town/city drop an "R" from it's name?  :lol: :lol:

Jim

Offline WeatherBeacon

  • Chief
  • Forecaster
  • *****
  • Posts: 1369
    • http://www.wxbeacon.com
Re: PHP Script to Display Your Wunderground Historical Data
« Reply #24 on: February 21, 2008, 01:39:43 PM »

Hey bruecksteve,
  Did your town/city drop an "R" from it's name?  :lol: :lol:

Jim

He he! Yeah, I think so, too! Even if not, I think you should add one, Steve. :mrgreen:  Where is that fang emoticon when I need one? Oh yeah ... I lost my fangs.

Kevin...
Mae govannen!
Kevin  (Member AMS) http://www.wxbeacon.com               Genesee County, Michigan
Hardware:  Davis Vantage Pro Wireless, Midland WR-300
Software: VWS 14.01p43, WeatherFlash, & GRLevel3

 

anything