Re: PHP Weather 2.1.2
Brought to you by:
iridium
From: Pedro L. <li...@le...> - 2003-05-12 17:12:51
|
Hey Dan, On Mon, May 12, 2003 at 09:54:00AM -0700, Dan Martin wrote: > I have figured out after struggling a bit how to pull most of the > information in 2.1.2, but I am still having difficulties pulling > "Clouds" and "Weather." I know that the information is in an array, but > I am unclear on how to bring it out of the array. I had a problem where the METAR info that is pulled from the site and imported into the database went stale and wouldn't refresh. Anyone have the same issue? Maybe I didn't configure it right, but I do remember setting a timeout or expiration time. > > I also cannot seem to pull wind direction (SW, NW, W), but I can pull > the compass degree (135, 90, 110). I had this same issue when I was playing with 2.1.2. What I actually printed all the values in the array and see what info I could sort out and pull, but I couldn't find wind info. I'm going to play with 2.1.2 now and see what I can do with it. -Pedro > > > Here is the code: > > > $weather = new phpweather(); > $icons = new pw_images($weather); > $location = $weather->get_location(); > $image = $icons->get_sky_image(); > $data = $weather->decode_metar(); > $temp = $data[temperature]; > $windvar = $data[wind]; <-----This Doesn't Work > $cloudvar = $data[clouds]; <-----This Doesn't Work > $time = date("m/d/y g:i a",($data[time])); > $weathervar = $data[weather]; > > > echo "\n"; > echo "<div align='center'> > Portland, Oregon<br /> > <img src=\"$image\" height='45' width='75' border='0' alt='Current Sky' />"; > > > echo "<br />$weathervar[condition]<br /> > > </div>"; > > echo "<b>Temperature:</b> $temp[temp_f]°F<br />"; > echo "<b>Humidity:</b> $data[rel_humidity]%<br />"; > echo "<b>Wind:</b> $windvar[miles_per_hour]mph<br /> > <div align='center'>$time</div> > "; > > Thank you, > Dan Martin > > > > ------------------------------------------------------- > Enterprise Linux Forum Conference & Expo, June 4-6, 2003, Santa Clara > The only event dedicated to issues related to Linux enterprise solutions > www.enterpriselinuxforum.com > > _______________________________________________ > PHPWeather-devel mailing list > PHP...@li... > https://lists.sourceforge.net/lists/listinfo/phpweather-devel |