include("xml2array.php");
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,"http://weather/weather/all-output.xml");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
curl_setopt($ch, CURLOPT_USERPWD, 'admin:admin');
$output = curl_exec($ch);
#echo "
";
$array=xml2array($output);
#print_r($array);
?>
Temperature | Wind | Rain | Wind Chill |
echo $array['rss']['weather']['outsideTemp']." °F ";
$temp=$array['rss']['weather']['outsideTemp'];
$mint=$array['rss']['weather']['lowOutsideTemp'];
$maxt=$array['rss']['weather']['hiOutsideTemp'];
echo "";
echo "";
echo "";
echo " | Feels like ".$array['rss']['weather']['windchill']." °F ";
echo " | ";
echo "";
echo "Temp | High | Low | ";
echo "Today: | $maxt °F | $mint °F | ";
echo "".$array['rss']['weather']['hiOutsideTempTime']." | ".$array['rss']['weather']['lowOutsideTempTime']." | ";
echo " ";
?>
|
echo $array['rss']['weather']['winddirection']." ";
echo $array['rss']['weather']['windspeed']." MPH ";
echo $array['rss']['weather']['windBeaufortScale']." ";
echo "Max wind ".$array['rss']['weather']['hiWindSpeed']." MPH at ".$array['rss']['weather']['hiWindSpeedTime'];
?>
|
echo "Today: | ".$array['rss']['weather']['dailyRain']." | ";
echo "Rate (/hr): | ".$array['rss']['weather']['rainrate']." | ";
echo "High Rate: | ".$array['rss']['weather']['hiRainRate']." | ";
echo "Month Total: | ".$array['rss']['weather']['monthlyRain']." | ";
echo "Rain Season: | ".$array['rss']['weather']['totalRain']." | ";
?>
|
echo "Current: | ".$array['rss']['weather']['windchill']." °F | ";
echo "Low: | ".$array['rss']['weather']['lowWindchill']." °F at ".$array['rss']['weather']['lowWindchillTime']." | ";
?>
|
Barometer | Humidity/Dew Point | |
echo "Current: | ".$array['rss']['weather']['barometer']." inHg | ";
echo "1-Hr Trend: | ".$array['rss']['weather']['baromtrend']." | ";
?>
|
echo "Humidity: | ".$array['rss']['weather']['outsideHumidity']." % | ";
echo "Today: | H: ".$array['rss']['weather']['hiHumidity']."% L: ".$array['rss']['weather']['lowHumidity']."% | ";
echo "Dew Point: | ".$array['rss']['weather']['outsideDewPt']." °F | ";
?>
| |