cloudy

Author Topic: PHP Extraction of WD Avg/Ext HTM Files  (Read 43065 times)

0 Members and 1 Guest are viewing this topic.

Offline MCHALLIS

  • Posts: 2,102
  • Long Beach, WA USA
    • Weather for Long Beach, WA USA
Re: PHP Extraction of WD Avg/Ext HTM Files
« Reply #135 on: March 16, 2008, 07:46:25 PM »
Hi Mike

Thanks for your reply.

Im not sure where you set the table-row-dark and light - do you specify that in Kevins avgextract.php?

Best regards,

Henrik


table-top, column-light, and column-dark. are part of the CSS files included with the
Weather Display/PHP/AJAX Website Template Set
http://saratoga-weather.org/template/ for which include-wxhistory.php was adapted for


Offline jwwd

  • Posts: 3,545
  • Silkeborg, Denmark (56:10:58 N-09:30:26 E) - Elevation 75,35 meters
    • Weather at Silkeborg, Denmark
Re: PHP Extraction of WD Avg/Ext HTM Files
« Reply #136 on: March 17, 2008, 11:10:48 AM »
Hi Mike

Ohh now I understand - I have modified my report page and its working great. And im using my css file.

http://www.buskelundtoften.dk/vejret/english/rapporter.php

Thank you very much for all your help.

Best regards,

Henrik

Offline MCHALLIS

  • Posts: 2,102
  • Long Beach, WA USA
    • Weather for Long Beach, WA USA
Re: PHP Extraction of WD Avg/Ext HTM Files
« Reply #137 on: April 05, 2008, 02:58:59 PM »
I have attached an updated AvgExtract.php file.
This version supports WD V10.37j+

Since Brian did the rewrite of the Avg/Ext in WD V10.37j+, this file had to be updated.
My fixes are backward compatible with the reports generated with the earlier version.
Rename it from AvgExtract.php.txt to AvgExtract.php then upload it to your server to replace the current AvgExtract.php
   
Edit: see my later post from 04/06/08 for the download
« Last Edit: April 06, 2008, 02:11:08 PM by MCHALLIS »

Offline jwwd

  • Posts: 3,545
  • Silkeborg, Denmark (56:10:58 N-09:30:26 E) - Elevation 75,35 meters
    • Weather at Silkeborg, Denmark
Re: PHP Extraction of WD Avg/Ext HTM Files
« Reply #138 on: April 05, 2008, 03:25:03 PM »
Hi Mike

What are the changes you have made?

I run a modified script because my wd files are in Danish.

Best regards,

Henrik


Offline MCHALLIS

  • Posts: 2,102
  • Long Beach, WA USA
    • Weather for Long Beach, WA USA
Re: PHP Extraction of WD Avg/Ext HTM Files
« Reply #139 on: April 05, 2008, 04:20:08 PM »
Hi Mike

What are the changes you have made?

I run a modified script because my wd files are in Danish.

Best regards,

Henrik



If you look in the file, I commented all the changes with
# mchallis 04/04/08

Offline jwwd

  • Posts: 3,545
  • Silkeborg, Denmark (56:10:58 N-09:30:26 E) - Elevation 75,35 meters
    • Weather at Silkeborg, Denmark
Re: PHP Extraction of WD Avg/Ext HTM Files
« Reply #140 on: April 05, 2008, 05:19:44 PM »
Hi again Mike

Thanks - didnt see that  :oops:

I have noticed for a while that the graph of the last day always is the day before the last day - ie. if you click the graphs for day 4 of April - you see the graph from April 3rd.

Same thing with all the monhts.

http://www.buskelundtoften.dk/vejret/english/rapporter.php?report=200804&size=1

What can be the problem?

Best regards,

Henrik

Offline MCHALLIS

  • Posts: 2,102
  • Long Beach, WA USA
    • Weather for Long Beach, WA USA
Re: PHP Extraction of WD Avg/Ext HTM Files
« Reply #141 on: April 05, 2008, 05:42:34 PM »
Hi again Mike

Thanks - didnt see that  :oops:

I have noticed for a while that the graph of the last day always is the day before the last day - ie. if you click the graphs for day 4 of April - you see the graph from April 3rd.

Same thing with all the monhts.

http://www.buskelundtoften.dk/vejret/english/rapporter.php?report=200804&size=1

What can be the problem?

Best regards,

Henrik

I would have to see the code from your AvgExtract.php file because I think the problem is in it.
Probably caused something you changed because my site does not have that problem
http://www.carmosaic.com/weather/monthly-stats.php

Offline jwwd

  • Posts: 3,545
  • Silkeborg, Denmark (56:10:58 N-09:30:26 E) - Elevation 75,35 meters
    • Weather at Silkeborg, Denmark
Re: PHP Extraction of WD Avg/Ext HTM Files
« Reply #142 on: April 05, 2008, 06:00:27 PM »
Hi Mike

Thanks for your reply.

Would you have a look at my script?

Its attached as a .txt file. (My English version)

Your help is very much appreciated.

Best regards,

Henrik

Offline n9mfk9

  • Posts: 469
  • Springfield IL, USA
Re: PHP Extraction of WD Avg/Ext HTM Files
« Reply #143 on: April 05, 2008, 06:19:22 PM »
Hi Mike i'm have the same problem
i am use the script as it was posted here

http://98.215.242.116:8080/wx11.php
thanks Beau

Offline TNETWeather

  • Kevin Reed (KrelvinAZ)
  • Global Moderator
  • Posts: 5,859
  • Gremlins are at work...
  • Mesa, AZ
    • TNET Weather Station - Mesa AZ
Re: PHP Extraction of WD Avg/Ext HTM Files
« Reply #144 on: April 05, 2008, 06:40:07 PM »
I'd kind of hold off a lot of script changes until the changes to the new output file is finished.

There are still some issues with the update that I assume Brian is going to address and when he does, the format of the output page may change further.

There still are some very basic HTML tags missing and in the wrong order that could make parsing an issue.

In a way, it would be nice if the output was simply a plain text file (April2008.txt) with no HTML in it at all.  It would make parsing it a lot easier and then the user can format the output the way they want to using their own style settings.
« Last Edit: April 05, 2008, 06:42:10 PM by TNETWeather »

All you need is Time, Aptitude and Desire ... and you can build just about anything...

Offline MCHALLIS

  • Posts: 2,102
  • Long Beach, WA USA
    • Weather for Long Beach, WA USA
Re: PHP Extraction of WD Avg/Ext HTM Files
« Reply #145 on: April 05, 2008, 06:48:01 PM »
Hi Mike

Thanks for your reply.

Would you have a look at my script?

Its attached as a .txt file. (My English version)

Your help is very much appreciated.

Best regards,

Henrik

Henrik,

here is a possible fix for your file, i also added in the compatibility changes you need for the latest WD.
Kevin is correct, more changes in WD might break something, but for now, try this.

Edit: removed the attachment because it was a special version just for Henrik and he already downloaded it.
« Last Edit: April 06, 2008, 02:12:31 PM by MCHALLIS »

Offline jwwd

  • Posts: 3,545
  • Silkeborg, Denmark (56:10:58 N-09:30:26 E) - Elevation 75,35 meters
    • Weather at Silkeborg, Denmark
Re: PHP Extraction of WD Avg/Ext HTM Files
« Reply #146 on: April 05, 2008, 07:03:51 PM »
Hi Mike and Kevin

I agree with you - lets not make any more changes to the script until Brian has finished the changes to the av/ext reports.

But - I just installed your (Mike) attached scripts and its working real fine now - both in Danish and English

Thank you very much for your help.

Best regards,

Henrik

Offline MCHALLIS

  • Posts: 2,102
  • Long Beach, WA USA
    • Weather for Long Beach, WA USA
Re: PHP Extraction of WD Avg/Ext HTM Files
« Reply #147 on: April 06, 2008, 02:09:57 PM »
One more small fix for Maximum humidity on the daily reports, the problem was the word humidity was showing up on the side where the values are.
I only changed one line
array('Maximum humidity',4), # mchallis 04/06/08 (WD 10.37j-01 fix) changed 3 to 4

#edit, I removed the attachment, see later post for latest AvgExtract.php attachment
« Last Edit: April 08, 2008, 02:54:30 PM by MCHALLIS »

Offline jwwd

  • Posts: 3,545
  • Silkeborg, Denmark (56:10:58 N-09:30:26 E) - Elevation 75,35 meters
    • Weather at Silkeborg, Denmark
Re: PHP Extraction of WD Avg/Ext HTM Files
« Reply #148 on: April 06, 2008, 02:34:14 PM »
Hi Mike

Thanks for the update - havent noticed yet.

Its working perfect.

Best regards,

Henrik

Offline MCHALLIS

  • Posts: 2,102
  • Long Beach, WA USA
    • Weather for Long Beach, WA USA
Re: PHP Extraction of WD Avg/Ext HTM Files
« Reply #149 on: April 08, 2008, 02:53:23 PM »
I updated AvgExtract.php to version 1.03

# mchallis Version 1.03 04/08/08 Added support for rain totals in mm

In AvgExtract.php I replaced
Code: [Select]
$level2 = array(
            array(',ET', 2),
            array('Sunshine hours month to date',6),
            array('Sunshine hours year to date',6),
            array('in. on day',0),
            array('in.  on day',0), # mchallis added 04/04/08 (WD 10.37j-01 fix)
            );

with
Code: [Select]
$level2 = array(
            array(',ET', 2),
            array('Sunshine hours month to date',6),
            array('Sunshine hours year to date',6),
            array('in. on day',0),
            array('in.  on day',0), # mchallis added 04/04/08 (WD 10.37j-01 fix)
            array('mm on day',0),  # mchallis added 04/08/08 support for rain in mm
            array('mm  on day',0), # mchallis added 04/08/08 support for rain in mm (WD 10.37j + fix)
            );

It will automatically print the correct rain totals no matter if you use inches or mm for rain.

 

cumulus