Re: Sorry! There's no data available for
Brought to you by:
iridium
From: Martin G. <gim...@gi...> - 2003-01-08 14:04:44
|
"Joao Rechena" <we...@is...> writes: > I've been trying to install the phpweather but I keep getting thins > message, even in the http://phpweather.sourceforge.net/ this > messsage appears when I try to get info from any country.... So it looks like your server is behind some sort of firewall that prevents PHP from fetching data from other servers... Try seeing what a PHP script like this gives you: <?php require('http://weather.noaa.gov/pub/data/observations/metar/stations/EKYT.TXT'); ?> If you don't get a page with a METAR, then something is blocking PHP. If that's the case, then you'll have to find another way to sneak data into PhpWeather past the firewall or whatever it is that is blocking. The db_updated.php file supplied with PhpWeather is surposed to do this by importing data from a so-called cycle-file. Such a file contains data for all stations from the last hour, so you should set up a cronjob or something similar to fetch the latest cyclefile from NOAA each hour and then call db_updater.php. We've been using this script at SourceForge to do this: #!/bin/sh #set -x if test -z "$1"; then CYCLE=$(date -u +%H); else CYCLE=$(date -u -d "$1" +%H); fi FILE=${CYCLE}Z.TXT; cd /home/groups/p/ph/phpweather/htdocs/phpweather if test -f $FILE; then rm $FILE; fi if wget -q http://weather.noaa.gov/pub/data/observations/metar/cycles/$FILE; then wget -q -O - "http://phpweather.sourceforge.net/phpweather/db_updater.php?filename=./$FILE"; rm $FILE; #echo "Done - database updated."; fi; -- Martin Geisler My GnuPG Key: 0xF7F6B57B See http://gimpster.com/ and http://phpweather.net/ for: PHP Weather => Shows the current weather on your webpage and PHP Shell => A telnet-connection (almost :-) in a PHP page. |