cvs: pear /Services_Weather/examples weather.com-basic.php
| From: | Alexander Wirtz | Date: | Wed, 01 Oct 2003 13:12:08 +0000 |
| Subject: | cvs: pear /Services_Weather/examples weather.com-basic.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-13219@lists.php.net to get a copy of this message | ||
eru Wed Oct 1 09:12:08 2003 EDT
Added files:
/pear/Services_Weather/examples weather.com-basic.php
Log:
Initial Revision
Index: pear/Services_Weather/examples/weather.com-basic.php
+++ pear/Services_Weather/examples/weather.com-basic.php
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4: */
// +----------------------------------------------------------------------+
// | PHP version 4 |
// +----------------------------------------------------------------------+
// | Copyright (c) 1997-2003 The PHP Group |
// +----------------------------------------------------------------------+
// | This source file is subject to version 2.0 of the PHP license, |
// | that is bundled with this package in the file LICENSE, and is |
// | available through the world-wide-web at |
// | http://www.php.net/license/2_02.txt.
|
// | If you did not receive a copy of the PHP license and are unable to |
// | obtain it through the world-wide-web, please send a note to |
// | license@php.net so we can mail you a copy immediately. |
// +----------------------------------------------------------------------+
// | Authors: Alexander Wirtz <alex@pc4p.net> |
// +----------------------------------------------------------------------+
//
// $Id: weather.com-basic.php,v 1.1 2003/10/01 13:12:08 eru Exp $
require_once "Science/Weather.php";
$weatherDotCom = &Science_Weather::service("WeatherDotCom", array("debug"
=> 2));
$weatherDotCom->setAccountData("<PartnerID>", "<LicenseKey>");
//$weatherDotCom->setCache("file", array("cache_dir" =>
"/tmp/cache/"));
$weatherDotCom->setUnitsFormat("metric");
$weatherDotCom->setDateTimeFormat("d.m.Y", "H:i");
$search = $weatherDotCom->searchLocation("Bonn, Germany");
$location = $weatherDotCom->getLocation($search);
$weather = $weatherDotCom->getWeather($search);
$forecast = $weatherDotCom->getForecast($search, 3);
var_dump($location);
var_dump($weather);
var_dump($forecast);
?>