code & tutorials / php classes / class weather home contact sitemap search print view add to favourites recommend site guestbook deutsch/german  

« a journey of a thousand miles starts in front of your feet. »
(lao tzu)

 

 

class yahoo weather

i wrote a new php class, that makes it very easy to use weather data from weather.yahoo.com! an integrated caching-system makes it very fast. you can download the class right here for free.

you need only 4 lines of code to get the actual weather situation and 2 day forecast of any location, that is provided by weather.yahoo.com! integrated caching (you can define the cache lifetime by your own) prevents your application to load the same data every page hit. this makes the rss parsing very fast!

  1. // Include the classes
  2. include("class.xml.parser.php");
  3. include("class.weather.php");
  4.  
  5.  // LocationCode, seconds cachelifetime, TempUnit (F or C)
  6. $weather_chile = new weather("CIXX0020", 3600, "C");
  7.  
  8. // Parse the weather data with caching
  9. $weather_chile->parsecached();
   

PHPClasses.org view this package on phpclasses.org

 
     
  © by marco voegeli, switzerland       357088 visitors total / © & disclaimer up