[Gambas-user] gambas and outportb
Rob Kudla
sourceforge-raindog2 at ...94...
Sat Jun 24 08:20:15 CEST 2006
On Sat June 24 2006 01:46, Laxminarayan G Kamath A wrote:
> On 06/23/06 13:46, mike webb wrote:
> >writing a program to control our air condition units in our
> > factory. have always used ms-dos and turbo c to control
> > hardware. in this case though, i need to access web pages on
> > the Internet and extract our local temp.
>
> _Bad_ programming practice.. never do this for mission
> critical stuff. what will happen if the page changes a bit for
> some reason and wrong values go in? _HAVOC_ !
No, not havoc... sanity checks followed by error messages as
appropriate. I've been scraping Weather Underground for about 4
years to feed a KDE temperature + heat index/wind chill applet I
wrote, and the worst it's ever done is give me "--" or "0"
because it can't parse the data.
Before that, I wrote a currency converter that used Yahoo Finance
as a back end (which I'm sure would now either be prevented by a
CAPTCHA or just against their terms of use), and when they
changed their format I had it throw an error saying "Yahoo
Format Error - If this persists, call Rob." It's not like my
company at the time would have gotten 1 dollar = 0 pounds and
had all its UK bills go out for infinite amounts.
If there's a better defined source for temperature data local to
him, he should use it (and I'm sorry if this sounds
condescending, but.... hello, thermostats are really not that
expensive), but scraping is a time-honored integration practice
when you have no control over your source data, and can
certainly be done right.
Rob
More information about the User
mailing list