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

0 Members and 1 Guest are viewing this topic.

Offline weatherforyou

  • Forecaster
  • *****
  • Posts: 508
  • My weather is on WeatherForYou.com. Is yours?
    • http://www.weatherforyou.com
Re: PHP Script to Display Your Wunderground Historical Data
« Reply #25 on: February 21, 2008, 02:25:17 PM »
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.
http://www.weatherforyou.com/history/

I could use some help bringing it up to date.  ;)
Joe Torsitano


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 #26 on: February 21, 2008, 09:10:06 PM »
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.
http://www.weatherforyou.com/history/

I could use some help bringing it up to date.  ;)

I wasn't very clear on that, sorry Joe.  I found your page, but was taking you up on your offer ... you said "It's available to any personal weather station site that wants to use it."  Is it available for download?
Rick (K6DYC)
Have you joined USAWeatherFinder.com yet?

Offline jmcmurry

  • Jim McMurry
  • Forecaster
  • *****
  • Posts: 470
  • Davis Vantage Pro 2 Plus Wireless.
    • Juneau County Weather
Re: PHP Script to Display Your Wunderground Historical Data
« Reply #27 on: February 22, 2008, 05:29:57 PM »
Sorry all, but there was a parsing error for the daily rain in the daily summary section.  I have that fixed now and have also added the option to omit cloud conditions from the tabular listing for those who don't wish to display those two columns.

I also updated all the .css files to include Ken True's idea to isolate all the styles that the script uses.  If you're having any issues along those lines you may want to update that too.

Everything has been updated in the .zip file at http://jcweather.us/scripts.php?mitem=130

Thanks.  - Jim

Forum Search and Google Can be Your Best Friends

Offline WeatherBeacon

  • Chief
  • Forecaster
  • *****
  • Posts: 1369
    • http://www.wxbeacon.com
Re: PHP Script to Display Your Wunderground Historical Data
« Reply #28 on: February 22, 2008, 08:29:00 PM »

Jim:

Which file(s) do we need to update?

Thanks!

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

Offline jmcmurry

  • Jim McMurry
  • Forecaster
  • *****
  • Posts: 470
  • Davis Vantage Pro 2 Plus Wireless.
    • Juneau County Weather
Re: PHP Script to Display Your Wunderground Historical Data
« Reply #29 on: February 22, 2008, 08:52:05 PM »
I'm sorry, the parsing error was in the WU-History.php file.  I'd standby though because I'm working up a couple other small fixes that I hope to have done soon.

- Jim

Forum Search and Google Can be Your Best Friends

Offline WeatherBeacon

  • Chief
  • Forecaster
  • *****
  • Posts: 1369
    • http://www.wxbeacon.com
Re: PHP Script to Display Your Wunderground Historical Data
« Reply #30 on: February 22, 2008, 08:55:35 PM »

I'm sorry, the parsing error was in the WU-History.php file.  I'd standby though because I'm working up a couple other small fixes that I hope to have done soon.

- Jim

Very good. Thanks for the "heads up".

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

Offline jmcmurry

  • Jim McMurry
  • Forecaster
  • *****
  • Posts: 470
  • Davis Vantage Pro 2 Plus Wireless.
    • Juneau County Weather
Re: PHP Script to Display Your Wunderground Historical Data
« Reply #31 on: February 22, 2008, 10:19:01 PM »
I fixed a few more things ... I guess these things are never done.  Here's the current status of WU-History.php:

Version 1.0 February 18, 2008
        1.1 February 19, 2008 - Fixed a broken link to WU & added optional selection of other stations
        1.2 February 20, 2008 - Fixed an obscure link bug dealing with the new "other station" option
        1.3 February 22, 2008 - Added option to omit cloud conditions from tabular listing.  Fixed solar & rain issue in the summary section
        1.4 February 22, 2008 - Suppressed Solar & UV graphs in monthly & longer modes. Suppressed current conditions in the summary except when viewing the current day

The .zip download is current.

Thanks.  - Jim

Forum Search and Google Can be Your Best Friends

Offline jmcmurry

  • Jim McMurry
  • Forecaster
  • *****
  • Posts: 470
  • Davis Vantage Pro 2 Plus Wireless.
    • Juneau County Weather
Re: PHP Script to Display Your Wunderground Historical Data
« Reply #32 on: February 23, 2008, 11:58:16 AM »
Sorry for all the changes, but we're adding some nice features along with fixing my knuckleheaded mistakes.  A new WU-History.php:

//        1.5 February 23, 2008 - Fixed precip error when viewing previous individual days.  Added optional top link in header to return to "today" when off somewhere else.

The .zip file has been updated.

- Jim

Forum Search and Google Can be Your Best Friends

Offline anchorageweather

  • Forecaster
  • *****
  • Posts: 445
    • http://eetee.us/station/station.php
Re: PHP Script to Display Your Wunderground Historical Data
« Reply #33 on: February 23, 2008, 12:16:12 PM »
Sorry for all the changes, but we're adding some nice features along with fixing my knuckleheaded mistakes.  A new WU-History.php:

//        1.5 February 23, 2008 - Fixed precip error when viewing previous individual days.  Added optional top link in header to return to "today" when off somewhere else.

The .zip file has been updated.

- Jim


Can you copy and paste the settings between:

Code: [Select]
//settings ----------------------------- */
and

Code: [Select]
// end of settings
//------------------------------------------------

from one version to the next?
South of the Tracks, Anchorage, KY

Offline jmcmurry

  • Jim McMurry
  • Forecaster
  • *****
  • Posts: 470
  • Davis Vantage Pro 2 Plus Wireless.
    • Juneau County Weather
Re: PHP Script to Display Your Wunderground Historical Data
« Reply #34 on: February 23, 2008, 01:59:42 PM »
No, but perhaps take them in groups of 5 or so until you see where I've added something.  I was trying to keep things in some sort of logical order so they'd be easier to find. 

- Jim

Forum Search and Google Can be Your Best Friends

Offline racenet

  • Forecaster
  • *****
  • Posts: 1290
    • NH Weather Data
Re: PHP Script to Display Your Wunderground Historical Data
« Reply #35 on: February 23, 2008, 02:26:26 PM »
Jim,

Was working on this last night and had some problems. First, had problems reading the page with the install instructions. Menus or whatever, were overlaping, covering the text.

In short, what, exactly needs to be done to include this script into a standard HTML page?
I looked at other PHP scripts I have included in standard HTML pages and this one doesn't seem to want to follow the same include rules.

Thanks.


Bob


 
www.theamericanflagstore.com - The American Flag Store



www.nhweatherdata.com - NH Weather Data

Offline jmcmurry

  • Jim McMurry
  • Forecaster
  • *****
  • Posts: 470
  • Davis Vantage Pro 2 Plus Wireless.
    • Juneau County Weather
Re: PHP Script to Display Your Wunderground Historical Data
« Reply #36 on: February 23, 2008, 03:18:52 PM »
Bob,

Do you mean that my scripts page is what you were having trouble reading?  If so, I wonder what that could be.

Anyway, you'll need to rename your .html page to .php so PHP will parse and process it.  Then within the <head> portion of the page add

<link rel="stylesheet" type="text/css" href="./WU-History.css" />

and in the body of the page add

<php
    include("WU-History.php");
?>

and that should be it unless you need to adjust paths to where those files are located.  Is that what you're asking?

Thanks.  - Jim

Forum Search and Google Can be Your Best Friends

Offline racenet

  • Forecaster
  • *****
  • Posts: 1290
    • NH Weather Data
Re: PHP Script to Display Your Wunderground Historical Data
« Reply #37 on: February 23, 2008, 03:40:06 PM »
Humm, it doesn't seem to want to parse anything.

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

Any suggestions?


Bob
www.theamericanflagstore.com - The American Flag Store



www.nhweatherdata.com - NH Weather Data

Offline jmcmurry

  • Jim McMurry
  • Forecaster
  • *****
  • Posts: 470
  • Davis Vantage Pro 2 Plus Wireless.
    • Juneau County Weather
Re: PHP Script to Display Your Wunderground Historical Data
« Reply #38 on: February 23, 2008, 04:26:12 PM »
Sorry Bob, that's because I have a stupid typo on my page.  :oops:

Should be <?php instead of <php

I'm very sorry.  - Jim

Forum Search and Google Can be Your Best Friends

Offline racenet

  • Forecaster
  • *****
  • Posts: 1290
    • NH Weather Data
Re: PHP Script to Display Your Wunderground Historical Data
« Reply #39 on: February 23, 2008, 04:40:22 PM »
LOL

No problem Jim. Yeah, that made a difference. Working much better now.  =D&gt;
Now, just gotta figure out how to tweak it.

Thanks


Bob


www.theamericanflagstore.com - The American Flag Store



www.nhweatherdata.com - NH Weather Data

Offline WeatherBeacon

  • Chief
  • Forecaster
  • *****
  • Posts: 1369
    • http://www.wxbeacon.com
Re: PHP Script to Display Your Wunderground Historical Data
« Reply #40 on: March 07, 2008, 02:09:53 PM »
Jim:

I downloaded Version 1.4 a day or two after you posted it and placed it on my server. (I already had the previous version running).

Just now I was looking at my precip on previous days, and I noticed that it shows 0 precip even on days in which it rained (and the "rainfall rate" graph shows precip, too). I thought this was a bug that you corrected. Or am I seeing a different issue?

If you happen to go to my site, click "Graphs" and look at Feb 17 or March 3, for example. I actually rec'd 0.42 inches on Feb 17.

Thanks, Jim!

Kevin...


EDIT:  Oops! Was this bug was fixed after Version 1.4? I'll give 1.6 a try.

That fixed it! Sorry folks. Just got over the flu ... bad mojo.
« Last Edit: March 07, 2008, 02:34:49 PM by WeatherBeacon »
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 jmcmurry

  • Jim McMurry
  • Forecaster
  • *****
  • Posts: 470
  • Davis Vantage Pro 2 Plus Wireless.
    • Juneau County Weather
Re: PHP Script to Display Your Wunderground Historical Data
« Reply #41 on: February 10, 2009, 06:12:55 PM »
I've updated this script again, now to version 2.3.  This puts a better fix on the average wind problem (thanks to Paul Gogan for that) and adds a variable so we can turn this off if/when Wunderground fixes the problem.

Paul discovered that they were sending that figure in mph whether you were receiving data in english or metric.  I put a ticket in, but haven't heard back yet and am tired of waiting.  I'll get the word out if they ever fix that and we'll turn that variable to false.

This will affect those who receive the data in metric format which seems to be most everyone outside the US.  The new variable is at the top of the list, so be careful to not overwrite it when transferring your settings over.   Download the .zip here

Thanks.  - Jim

Forum Search and Google Can be Your Best Friends

Offline jmcmurry

  • Jim McMurry
  • Forecaster
  • *****
  • Posts: 470
  • Davis Vantage Pro 2 Plus Wireless.
    • Juneau County Weather
Re: PHP Script to Display Your Wunderground Historical Data
« Reply #42 on: April 18, 2009, 05:26:50 PM »
New script update to Version 2.4 available at http://jcweather.us/scripts.php

Changed a column heading that was mis-labeled cm when it should have been mm (when units "both" was selected).

Noticed that Wunderground added solar, so the script will now optionally show that in the daily mode tabular data.

Please let me know if you have any problems.

- Jim

Forum Search and Google Can be Your Best Friends

Offline Maroney

  • Member
  • *
  • Posts: 11
Re: PHP Script to Display Your Wunderground Historical Data
« Reply #43 on: April 19, 2009, 12:01:15 PM »
Jim,

Unfortunately, I can't get the data to come across.
1) I'm using the latest revision 2.4
2) Initially, I was getting error codes till I changed the server settings to PHP 5 (from PHP 4)
3) If I put basic php code... echo 3+2; in the TestHistory.php, I'll get the result (PHP is working)
4) If I put the same basic code in the first line of WU-History.php, I'll get the result (WU-History.php is working)

other than that it's a big nothing.  I really like the work you've done, I hope I can get this working.
If you have any ideas, I'd appreciate it!

Thanks in advance
Paul

Offline sam2004gp

  • Mount Crawford, Virginia
  • Forecaster
  • *****
  • Posts: 2836
  • Weeeeeeeee!!!!
    • Mount Crawford Weather, VA
Re: PHP Script to Display Your Wunderground Historical Data
« Reply #44 on: April 19, 2009, 12:24:07 PM »
Jim,

Unfortunately, I can't get the data to come across.
1) I'm using the latest revision 2.4
2) Initially, I was getting error codes till I changed the server settings to PHP 5 (from PHP 4)
3) If I put basic php code... echo 3+2; in the TestHistory.php, I'll get the result (PHP is working)
4) If I put the same basic code in the first line of WU-History.php, I'll get the result (WU-History.php is working)

other than that it's a big nothing.  I really like the work you've done, I hope I can get this working.
If you have any ideas, I'd appreciate it!

Thanks in advance
Paul


FYI:
Wunderground is having some issues today, so you might check and see if those are related to some of your problems. 
SAM --->>> http://www.mountcrawfordweather.org
OS WMR-968 with a Dedicated PWS Weather Computer running VWS v13.01 p09


Offline jmcmurry

  • Jim McMurry
  • Forecaster
  • *****
  • Posts: 470
  • Davis Vantage Pro 2 Plus Wireless.
    • Juneau County Weather
Re: PHP Script to Display Your Wunderground Historical Data
« Reply #45 on: April 19, 2009, 05:23:02 PM »
Paul,

First I've heard of anything like that.  I can see where if Wunderground doesn't serve up the csv file, it would stall.  If it continues, perhaps provide us a link so we can see it first hand.

- Jim

Forum Search and Google Can be Your Best Friends

Offline Maroney

  • Member
  • *
  • Posts: 11
Re: PHP Script to Display Your Wunderground Historical Data
« Reply #46 on: April 19, 2009, 08:32:07 PM »

Jim,

Thanks for the response, here's what I've found.

I took your files and put them on my other website I have hosted with yahoo, and poof, no problem. Everything was perfect.

Seems as though my other hosting company supports PHP, but something is missing, or a configuration file is set incorrectly.
Does my PHP.ini need to be configured a certain way? Here's what it looks like.
Thanks again for a great product!

Paul




[PHP]
display_errors = Off

; This is the default PHP 5-style version of the php.ini settings file.
; It is based on /usr/local/etc/php5/php.ini-recommended. For full reference
; of all possible configuration directives and their default values,
; please visit http://www.php.net/manual/en/print/ini.php

allow_call_time_pass_reference = Off   ; Code cleanliness
magic_quotes_gpc = Off         ; Performance
output_buffering = 4096         ; Performance
register_argc_argv = Off      ; Performance
register_globals = Off         ; Security, Performance [default]
register_long_arrays = Off      ; Performance
variables_order = "GPCS"      ; Performance
zlib.output_compression = On      ; Performance
allow_url_fopen = Off
allow_url_include = Off

cgi.fix_pathinfo = 1
error_reporting = E_ALL & ~E_NOTICE & ~E_STRICT
fastcgi.log = 0
max_execution_time = 15
max_input_time = 60
memory_limit = 32M
safe_mode_exec_dir =
upload_max_filesize = 10M
url_rewriter.tags = "a=href,area=href,frame=src,input=src,form=fakeentry"

;include_path = ".:/usr/local/share/pear"

[Session]
session.bug_compat_42 = 0
session.gc_divisor = 1000
session.hash_bits_per_character = 5

;[eaccelerator]            ; *broken* (does not cope well with PHP5 yet)
;;extension="eaccelerator.so"      ; [Performance]
;eaccelerator.cache_dir="/tmp"
;eaccelerator.shm_size="4"
;eaccelerator.shm_only="1"

; All PHP5 extensions are dynamic and could be loaded on demand.
; The following ones used to be pre-loaded by default in PHP4,
; so we keep these enabled for backward compatibility:
extension=ctype.so
; extension=xslt.so

extension=mysql.so
extension=pcre.so
extension=posix.so
extension=session.so
extension=tokenizer.so
extension=xml.so
extension=zlib.so
;extension=simplexml.so
;extension=spl.so
;extension=sqlite.so

; In order to pre-load some of the following extensions,
; you would need to uncomment the appropriate line(s) below.
; extension=curl.so
 extension=ftp.so
; extension=gd.so
;extension=gettext.so
;extension=iconv.so
; extension=imap.so
;extension=mbstring.so
;extension=mcrypt.so
;extension=mhash.so
;extension=openssl.so
;extension=sockets.so
;extension=dom.so
;extension=xsl.so

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 6540
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: PHP Script to Display Your Wunderground Historical Data
« Reply #47 on: April 19, 2009, 08:35:10 PM »
It's most likely the

allow_url_fopen = Off

that causes a problem.  Change it to

allow_url_fopen = on

and the script should work fine :)

Best regards,
Ken
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Boltek-PCI/NexStorm, microSferics ToA, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge/hub
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline Maroney

  • Member
  • *
  • Posts: 11
Re: PHP Script to Display Your Wunderground Historical Data
« Reply #48 on: April 19, 2009, 09:16:56 PM »

Ken,

Thanks for the response.

Unfortunately, it didn't work. I'm not sure what's different with yahoo hosting vs. my other company. (aplus.net)
I prefer aplus.net, trying to get anything done with yahoo is ridiculous.

Again, thanks for the help.
Paul

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 6540
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: PHP Script to Display Your Wunderground Historical Data
« Reply #49 on: April 22, 2009, 02:00:44 PM »
I'd tried Yahoo hosting, but found it too restrictive (forced safe_mode and allow_url_fopen turned off)
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Boltek-PCI/NexStorm, microSferics ToA, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge/hub
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

 

anything