Re: Fetching Local Weather
| From: | Anna | Date: | Fri, 09 Feb 2001 21:06:03 +0000 |
| Subject: | Re: Fetching Local Weather | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-39018@lists.php.net to get a copy of this message | ||
----- Original Message -----
>From: "JB" <jbeebe@aimsmarketing.com>
>Hey Coders,
>I know there's a couple premade scripts to grab weather on hotscripts.com.
I wanted to know if anyone has a simple method to fetch the day's local
weather from something like yahoo. All I really need is the temperature,
condition (rainy, sunny)and maybe windspeed. If I could include the icon for
the condition that would be good too. Anyone have a simple solution for this
that I can dump into my code?
>Thanks.
Using combinations of:
$string=implode(file("http address"), "");
$array=explode("<some starter tag>", $string);
$array=explode("<some end tag>", $array[1]);
$endString=$array[0];
With the odd ereg_replace() to tweak the data you
can grab info from wherever you want.
However, you should get permission from the site,
since this would count as a hit/page view on their site.
Anna