Weather-Watch.com
February 09, 2010, 10:28:41 AM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
Members: 9,223  Posts: 342,196  Topics: 37,967
Please welcome spudsmom, our newest member.

Latest versions: WD - 10.37P  WDL - 6.05  MML - 1.03
 News:
Check out the new FAQs (Frequently Asked Questions) board for a growing list of hints, tips and diagnostic suggestions.
  Advanced Search
   Home   Bug Tracker Photo Gallery Wiki Chat Calendar Search Login Register Help  
Pages: [1] 2 3 ... 12
  Print  |  « previous  |  next »  |  Go Down  
Author Topic: PHP Extraction of WD Avg/Ext HTM Files  (Read 35839 times)
0 Members and 1 Guest are viewing this topic.
TNETWeather
Kevin Reed (KrelvinAZ)
Weather Controller
*****
Offline Offline

Location: Mesa, AZ
Station Type: Davis Vantage Pro2 Plus W/FARS Wireless
Posts: 5,512
Local Time: Tuesday 04:28


Gremlins are at work...


WWW
« on: December 22, 2007, 08:37:15 PM »

The source code for the extraction PHP code that I used to read an existing Avg/Ext htm file (i.e. December2007.htm), is now available.

Basically, it reads the Avg/Ext file, strips out the HTML (actually ignore it) and then sets up some tables for each day with CSS tags that allow you to pretty it up.

Note:
This version of the script will not work with the newer format of the Avg/Ext html file.  See below for a different link:

Scripts Page:
http://www.tnetweather.com/tws-avgext-script.php

It should continue to work after the current bug with the no ending tag for the <FONT stuff that is currently in it as long as the fix is consistent with how the other HTML is used.  If not, I will update it after it gets fixed.

One will need to point to the files they want, where they are located etc... and might need some tweaking.

Current working version of this script updated by Mike Challis:

http://www.weather-watch.com/smf/index.php/topic,28547.msg250037.html#msg250037
« Last Edit: April 11, 2008, 02:47:37 PM by TNETWeather » Logged

All you need is Time, Aptitude and Desire ... and you can build just about anything...
jwwd
Junior Weather Controller
****
Offline Offline

Location: Silkeborg, Denmark (56:10:58 N-09:30:26 E) - Elevation 75,35 meters
Station Type: Davis Vantage Pro2 w/FARS & solardetector
Posts: 3,120
Local Time: Tuesday 12:28



WWW
« Reply #1 on: December 22, 2007, 09:12:52 PM »

Hi Kevin

I just tried your script - but canīt get the formatting to work:

http://www.buskelundtoften.dk/vejret/avgextract.php

http://www.buskelundtoften.dk/vejret/sample.php

Best regards,

Henrik
Logged

TNETWeather
Kevin Reed (KrelvinAZ)
Weather Controller
*****
Offline Offline

Location: Mesa, AZ
Station Type: Davis Vantage Pro2 Plus W/FARS Wireless
Posts: 5,512
Local Time: Tuesday 04:28


Gremlins are at work...


WWW
« Reply #2 on: December 22, 2007, 09:31:56 PM »

No way to provide any assistance without having a clue where you are pointing at for the data.
Logged

All you need is Time, Aptitude and Desire ... and you can build just about anything...
jmcmurry
Jim McMurry
Rain Maker
***
Offline Offline

Location: Mauston, WI, USA
Station Type: Davis Vantage Pro 2 Plus Wireless. StartWatch, VirtualVP, Boltek/NexStorm, GR3 & WxSim
Posts: 1,595
Local Time: Tuesday 05:28



WWW
« Reply #3 on: December 22, 2007, 09:35:00 PM »

Looking at the source, you seem to be missing the <table> and </table>  tags.

- Jim
Logged


 Home of NSLog NexStorm Lightning Data Manager
jwwd
Junior Weather Controller
****
Offline Offline

Location: Silkeborg, Denmark (56:10:58 N-09:30:26 E) - Elevation 75,35 meters
Station Type: Davis Vantage Pro2 w/FARS & solardetector
Posts: 3,120
Local Time: Tuesday 12:28



WWW
« Reply #4 on: December 22, 2007, 09:37:10 PM »

No way to provide any assistance without having a clue where you are pointing at for the data.

Hi Kevin

Ups - sorry - im pointing at the www.buskelundtoften.dk/vejret/vejrdata/December2007.htm

Best regards,

Henrik
Logged

TNETWeather
Kevin Reed (KrelvinAZ)
Weather Controller
*****
Offline Offline

Location: Mesa, AZ
Station Type: Davis Vantage Pro2 Plus W/FARS Wireless
Posts: 5,512
Local Time: Tuesday 04:28


Gremlins are at work...


WWW
« Reply #5 on: December 22, 2007, 09:39:31 PM »


Won't work with non-english tags.  It looks for Engish tags to know when and where to put the data.

Look at the data arrays at the bottom.  Will most likely need a lot of tweaking.

   $parts = array(
        array("Daily rain totals",0),
        array(". on day",0),
        array("Average ",3),
        array("Rainfall for month",4),
        array("Rainfall for year ",4),
        array("Maximum rain per minute",5),
        array("Maximum temp",3),
        array("Minimum temp",3),
        array("Maximum pressure",3),
        array("Minimum pressure",3),
        array("Maximum windspeed",3),
        array("Minimum guest",4),
        array("Maximum heat index",4),
        array("Minimum humi",3),
        array("Maximum humi",3),
        array("Growing degrees days",4),
    );
   
    // String, action 1 = skip 0 = print 2 = print blank, level, needpart
   
    $extracts = array (
        array("<pre>",1,1,0),
        array("daily report for ",1,0,1),
        array("font",1,0,0),
        array("pre",1,0,0),
        array("<hr>",1,2,0),
        array("-------",2,0,0),
        array("extremes for the month",1,3,1),
        array("extremes for day :",1,0,1),
    );
Logged

All you need is Time, Aptitude and Desire ... and you can build just about anything...
jwwd
Junior Weather Controller
****
Offline Offline

Location: Silkeborg, Denmark (56:10:58 N-09:30:26 E) - Elevation 75,35 meters
Station Type: Davis Vantage Pro2 w/FARS & solardetector
Posts: 3,120
Local Time: Tuesday 12:28



WWW
« Reply #6 on: December 22, 2007, 09:42:59 PM »

Hi again Kevin

Oh yes - of course - i will give it a try.

Thanks for your reply.

Best regards,

Henrik
Logged

TNETWeather
Kevin Reed (KrelvinAZ)
Weather Controller
*****
Offline Offline

Location: Mesa, AZ
Station Type: Davis Vantage Pro2 Plus W/FARS Wireless
Posts: 5,512
Local Time: Tuesday 04:28


Gremlins are at work...


WWW
« Reply #7 on: December 22, 2007, 10:16:44 PM »

Henrik,

This gets closer...

http://www.tnetweather.com/scripts/wdavgext/test2.php

http://www.tnetweather.com/scripts/wdavgext/test2.txt
Logged

All you need is Time, Aptitude and Desire ... and you can build just about anything...
jhobby
Junior Forecaster
****
Offline Offline

Location: Silver Cliff, Colorado, USA
Station Type: OS WMR968
Posts: 76
Local Time: Tuesday 03:28


WWW
« Reply #8 on: December 23, 2007, 02:31:45 AM »

Kevin, as usual Very Nice script,tried it out :

http://hobbyweather.com/avg.php

All I have to do is come up with a .gif image for it ?

Thank You.-Jeff
Logged
TNETWeather
Kevin Reed (KrelvinAZ)
Weather Controller
*****
Offline Offline

Location: Mesa, AZ
Station Type: Davis Vantage Pro2 Plus W/FARS Wireless
Posts: 5,512
Local Time: Tuesday 04:28


Gremlins are at work...


WWW
« Reply #9 on: December 23, 2007, 02:35:45 AM »

Ideally, you would add this to your website current style and change the colors to match.

In your case, it would use your weather websites, current top bar as the title area. and you would use colors that match the style you have there.

You would then have a menu item pointing to that "page"
Logged

All you need is Time, Aptitude and Desire ... and you can build just about anything...
jhobby
Junior Forecaster
****
Offline Offline

Location: Silver Cliff, Colorado, USA
Station Type: OS WMR968
Posts: 76
Local Time: Tuesday 03:28


WWW
« Reply #10 on: December 23, 2007, 02:44:23 AM »

Kevin, Yes I am not very good at this yet, I have to try someone's own work then spend a week trying to get it in my stuff.

Thanks Again.-Jeff
Logged
TNETWeather
Kevin Reed (KrelvinAZ)
Weather Controller
*****
Offline Offline

Location: Mesa, AZ
Station Type: Davis Vantage Pro2 Plus W/FARS Wireless
Posts: 5,512
Local Time: Tuesday 04:28


Gremlins are at work...


WWW
« Reply #11 on: December 23, 2007, 02:55:06 AM »

Try this CSS.... that will get you started...

Code:
        body { font-family: verdana, san-serif; background-color: #FFFFFF; color: #000000;}
        a { font-size: 80%; text-decoration: none; color: #000000; font-weight: bold;
            padding-right: 340px; }
        a:visit { text-decoration: none; color: #000000; font-weight: bold;  }
        a:hover { text-decoration: underline; color: #000000; font-weight: bold;  }
        h1 { color: #000000; font-size: 120%; background-color: #639532; width: 60%;
            padding: 2px; border: 1px solid #000000;
            border-right: 3px solid #000000; border-bottom: 3px solid #000000; }
        h2 { font-size: 110%; }
        h3 { color: #000000; font-size: 100%; background-color: #639532; width: 30%;
            padding: 2px; border: 1px solid #000000;
            border-right: 3px solid #000000; border-bottom: 3px solid #000000;}
        .tbl { width: 65%; border: 1px solid #000000; border-collapse: collapse;
            border-right: 4px solid #000000; border-bottom: 4px solid #000000; }
        .left  { color: #000000; padding-left: 5px; font-family: verdana; width: 250px;
            border: 1px solid black; background-color: #D1F7AD;}
        .right { color: #000000; padding-left: 5px; font-family: "courier new", monospace;
            font-size: 90%; border: 1px solid black; background-color: #D1F7AD;}
        .rtbl { width: 25%; border: 1px solid #4A2409; border-collapse: collapse;
            border-right: 4px solid #000000; border-bottom: 4px solid #000000; }           
        .rain { text-align: center; color: #000000; padding-left: 5px;
            font-family: verdana; width: 250px;
            border: 1px solid black; background-color: #D1F7AD;}
Logged

All you need is Time, Aptitude and Desire ... and you can build just about anything...
jhobby
Junior Forecaster
****
Offline Offline

Location: Silver Cliff, Colorado, USA
Station Type: OS WMR968
Posts: 76
Local Time: Tuesday 03:28


WWW
« Reply #12 on: December 23, 2007, 02:59:58 AM »

Kevivn, Thank You Very Much, I am on it.
-Jeff
Logged
firewall
Rain Maker
***
Offline Offline

Location: Branford Connecticut
Station Type: Davis VP-2
Posts: 1,335
Local Time: Tuesday 06:28



WWW
« Reply #13 on: December 23, 2007, 03:07:35 AM »

Wow, go away for a few hours and Kevin adds all kinds of new scripts! Laughing Thanks for the new toys Kevin, Merry Christmas! Got it working in no time, now for the right place to add it....hmmmm. Looks like this will need a form type page to pick the month!

Jack
Logged

jwwd
Junior Weather Controller
****
Offline Offline

Location: Silkeborg, Denmark (56:10:58 N-09:30:26 E) - Elevation 75,35 meters
Station Type: Davis Vantage Pro2 w/FARS & solardetector
Posts: 3,120
Local Time: Tuesday 12:28



WWW
« Reply #14 on: December 23, 2007, 05:48:13 AM »


Hi Kevin

Thanks - its looking much better - i tried myself to change some of the words to Danish - but got it all messed up.

There is missing some lines from the December2007.htm - see attached pic where I have marked the missing with red, and the rain totals in the bottom.

www.buskelundtoften.dk/vejret/sample.php

Thanks for anohter great script.

Best regards,

Henrik


* avgextract.JPG (65.51 KB, 870x500 - viewed 223 times.)
« Last Edit: December 23, 2007, 05:50:35 AM by jwwd » Logged

Pages: [1] 2 3 ... 12
  Print  |  « previous  |  next »  |  Go Up  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!