[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [SLUG] Extracting Weather text out of a web page - Newbie Question



Hi,

Right, the way i "borrow" the weather from www.bom.gov.au is this:

1. in PHP ise the fopen function to read the entire page(source) into an
array.
2. run though the array and check each line for the occurance of some
certain text like: "Sydney           ".
3. strip off the other guff.
4. Stick the data you need in a DB, or on the file system.
5. Record the time you last got the data so you dont have to do it every
time someone views your page. Mine expires hourly.

Matta


"Grahame M. Kelly" wrote:
> 
> Yes, I'll admit to being a html/web newbie.
> 
> So, for a thick head on this side of the email, how does one extrace the
> temperature, due point, humidity textural information etc. from a page like
> 
> http://www.weather.com/weather/cities/as__sydney.html
> 
> Does anyone have a simpler more elegant solution ?
> 
> Thanks, Grahame
> --
> Webpage -> http://www.wildpossum.com
> Member SLUG (Sydney Linux User Group) www.slug.org.au
> 
> --
> 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

-- 
Matt Allen                                      Linux/PHP eCommerce
Solutions
Linux Worx                                      Linux Networking
www.linuxworx.com.au                            Consulting
matt@nospam.linuxworx.com.au                           
0413 777 771
--
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