![]() |
Local Temperature Data as Input to Computer Programs
Where can one find a machine-readable temperature table which gives one's current official temperature? Here is the problem in a nutshell. I want to use the local temperature as input to a UNIX script that will turn up our thermostat in the Winter. The idea is to wait until later in the morning to turn it up when the outside air temperature is warmer since it won't take as long to heat up on warmer days than when the temperature is below freezing. I thought I had it made when I found that the NWS gives our local airport conditions so I wrote a UNIX "expect" script that does successfully fire off the lynx browser and capture the text of the web page with all the current conditions. The trouble is that it takes more or less fields to describe the current conditions which means that the temperature migrates up and down the line depending upon how much information is ahead of it. It can be the tenth field or the eighth field, etc. I realized that I can't look for any identifying strings since the temperature is normally part of a column. The text rendering process destroys the formatting so I can't use position. In short, it is too randomized to mechanically find 100% of the time. What I need is a table meant as input to electronic devices that keeps some sort of fairly rigid format so that mechanical processes can find the data. The link for local conditions I have been using is http://www.srh.noaa.gov/data/obhistory/KSWO.html It would be perfect if the temperature stayed in the same field each time. Thanks for any good ideas. -- Martin McCormick WB5AGZ Stillwater, OK Information Technology Division Network Operations Group |
Local Temperature Data as Input to Computer Programs
Would this be easier to read?
http://www.uswx.com/us/stn/?code=c&n=25&stn=KSWO "Martin McCormick" wrote in message ... Where can one find a machine-readable temperature table which gives one's current official temperature? Here is the problem in a nutshell. I want to use the local temperature as input to a UNIX script that will turn up our thermostat in the Winter. The idea is to wait until later in the morning to turn it up when the outside air temperature is warmer since it won't take as long to heat up on warmer days than when the temperature is below freezing. I thought I had it made when I found that the NWS gives our local airport conditions so I wrote a UNIX "expect" script that does successfully fire off the lynx browser and capture the text of the web page with all the current conditions. The trouble is that it takes more or less fields to describe the current conditions which means that the temperature migrates up and down the line depending upon how much information is ahead of it. It can be the tenth field or the eighth field, etc. I realized that I can't look for any identifying strings since the temperature is normally part of a column. The text rendering process destroys the formatting so I can't use position. In short, it is too randomized to mechanically find 100% of the time. What I need is a table meant as input to electronic devices that keeps some sort of fairly rigid format so that mechanical processes can find the data. The link for local conditions I have been using is http://www.srh.noaa.gov/data/obhistory/KSWO.html It would be perfect if the temperature stayed in the same field each time. Thanks for any good ideas. -- Martin McCormick WB5AGZ Stillwater, OK Information Technology Division Network Operations Group |
Local Temperature Data as Input to Computer Programs
In article ,
TQ ToweringQs AT adelphia.net wrote: Would this be easier to read? http://www.uswx.com/us/stn/?code=c&n=25&stn=KSWO Many thanks. If all the fields stay populated with something all the time, it's working great. -- Martin McCormick WB5AGZ Stillwater, OK Information Technology Division Network Operations Group |
Local Temperature Data as Input to Computer Programs
Sometimes elements are missing from the observation, but temperature is
always before the first '/'. Here's another source in case uswx.com is down... a href = "http://www.rap.ucar.edu/weather/surface/index.php?metarIds=kswo&hoursStr=mo st+recent+only&std_trans=standard&num_metars=numbe r&submit_metars=Retrieve" Most recent observation/a a href = "http://www.rap.ucar.edu/weather/surface/index.php?metarIds=kswo&hoursStr=pa st+6+hours&std_trans=standard&num_metars=number&su bmit_metars=Retrieve" Past 6 hrs... /a Main page... http://www.rap.ucar.edu/weather/surface/ Tried to ensure the URL would wrap. Sorry if the HTML doesn/t quite work. "Martin McCormick" wrote in message ... In article , TQ ToweringQs AT adelphia.net wrote: Would this be easier to read? http://www.uswx.com/us/stn/?code=c&n=25&stn=KSWO Many thanks. If all the fields stay populated with something all the time, it's working great. -- Martin McCormick WB5AGZ Stillwater, OK Information Technology Division Network Operations Group |
All times are GMT. The time now is 11:54 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2006 WeatherBanter.co.uk