This is just a quick overview of how you could do it - unfortunately I don't have the time to do this slowly or the experience to do it quickly... Essentially, you need to load the weather web page and then extract bits from it.
Loading the page
The best (and perhaps only) way to do this is server side. cURL is a popular library in php that would work. It may be possible to do it client side via XMLHttpRequest (there are a lot of nice high level wrappers for this now like this one), though most browsers will block cross domain access. (So if the weather server is on a different domain from yours, it won't work.) Of course you could always do both - have php pull the data and then load it from your site with some funky AJAX code.
Extracting bits
Both php and JavaScript (and lots of other languages) allow you to use regular expressions to pull segments out of a string. (Look at preg_match and match.) For instance, run a search for 'humidity' and get the substring from that until the second </td> after that. Then strip the tags (php = strip_tags()) and you've got what you want. Note that this is unlikely to be robust - if they change the site, it will probably break your reg exps.
Having said all that, it's probably a lot easier to track down your weather data from another source designed for machines to read. That would certainly be my preferred option  (You may also be breaking their TOS by scraping the site.)
Hmmm... Not sure if that helps or not.
__________________
Please login or register to view this content. Registration is FREE - Pole dancing evolved
|