Author Topic: Parse WD climatedataout.html  (Read 3202 times)

0 Members and 1 Guest are viewing this topic.

Offline TNETWeather

  • Kevin Reed (KrelvinAZ)
  • Senior Contributor
  • ****
  • Posts: 193
  • Davis Vantage Pro2+ with full FARS
Parse WD climatedataout.html
« on: December 10, 2007, 11:39:29 PM »
This was a lot more difficult....

This code snippet parses the Weather-Display climatedataout.html file that is uploaded by WD to your webserver. The purpose of the script is to obtain the values from the html file so that you could use it in a graph, chart, whatever...

This is not a complete script in that it only gets the data, you have to know what to do with the data...

The following page has a sample output of what you could do with the data and includes the source code:

TNET Weather - Parse WD climatedataout.html Script

The script includes a method of extracting the data for download via CSV format.
All you need is Time, Aptitude and Desire ... and you can build just about anything...

Offline TNETWeather

  • Kevin Reed (KrelvinAZ)
  • Senior Contributor
  • ****
  • Posts: 193
  • Davis Vantage Pro2+ with full FARS
Re: Parse WD climatedataout.html
« Reply #1 on: December 11, 2007, 08:29:19 PM »
The style CSS that I applied to this script is below but not included in the script itself:

Code: [Select]
<style type="text/css" >
#sampscript {
font-family: 'Courier New', monospace;
font-size: 80%;
}

#sampscript table {
width: 99%;
font-color: #008000;
border: 1px solid #22464F;
border-right: 4px solid #22464F;
border-bottom: 4px solid #22464F;
border-collapse: collapse;
padding: 2px;
}

#sampscript th, td {
font-color: #008000;
font-size: 100%;
border: 1px solid #22464F;
background-color: white;
text-align:center;
}

#sampscript th {
font-size: 80%;
background-color: #CDDBCD;
}

#sampscript pre {
font-size: 80%;
color: black;
}

</style>
All you need is Time, Aptitude and Desire ... and you can build just about anything...