Services_Weather
| From: | Ben Cade | Date: | Thu, 30 Dec 2004 15:20:46 +0000 |
| Subject: | Services_Weather | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-16518@lists.php.net to get a copy of this message | ||
Hello,
I am wondering if any have experience with the Services_Weather class? I am getting the following
error:
Error: Services_Weather (Weather.php:132): Requested service could not be found.
Here is the script I am running:
<?php
// include class file
include('Weather.php');
// instantiate object for METAR decoding
$metar = &Services_Weather::service("METAR", array("debug" => 0));
if (Services_Weather::isError($metar))
{ die("Error: ".$metar->getMessage()."\n");
}
// set location identifier
$location = "EGLL";
// construct URL to NOAA METAR site using location identifier
$url = "ftp://weather.noaa.gov/data/observations/metar/stations/".$location.".TXT";
// retrieve and parse METAR
$data = $metar->_parseWeatherData($url);
// display parsed data
print_r($data);
?>
Any help is appreciated. Thanks.
b.cade@charter.net