[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [SLUG] Extracting Weather text out of a web page - Newbie Question
Grahame M. Kelly wrote:
> Yes, I'll admit to being a html/web newbie.
Sure. As if. ;)
> Does anyone have a simpler more elegant solution ?
Certainly - you're best best for parsing a webpage for "stuff" is Perl, but
the trouble is, the site will always change, forcing you to rewrite the
code.
Better solution: Go to *their* source! (well, likely source)
http://weather.noaa.gov/
Read about METAR coded observations at the bottom, or, just grab the one
from Sydney Airport which is right here:
ftp://weather.noaa.gov/data/observations/metar/decoded/YSSY.TXT
(I'm assuming here that you want to show webcam viewers what sort of weather
the cockies and possums are... weathering?)
There's also some PHP code that does this for all of the available weather
stations:
http://www.akooe.com/akooe.php/webmaster_en.html
I didn't spend much time getting it to work, however. There is an obvious
problem with it to begin with in that one of the files that relies on PHP
is an .html file - not so great for anyone with a sane PHP setup (why parse
*all* your html files?)
- Jeff
-- jdub@nospam.slug.org.au ----------------------------- http://www.slug.org.au/ --
linux.conf.au - coming to Sydney in January 2001
Get Linux Around Ausralia - http://linux.org.au/installfest/
--
SLUG - Sydney Linux Users Group Mailing List - http://www.slug.org.au
To unsubscribe send email to slug-request@nospam.slug.org.au with
unsubscribe in the text