forked from rpringle/National-Weather-Service-Parser
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsample_output.php
More file actions
42 lines (38 loc) · 1.44 KB
/
Copy pathsample_output.php
File metadata and controls
42 lines (38 loc) · 1.44 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<?php
// Error reporting; turn off for production
//error_reporting(E_ALL);
// Include the NWS Parser function
include 'nws_weather_parser.php';
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>NWS Parser Sample Output</title>
</head>
<body>
<?php
// Run the function
$xml = parseWeather($localfeed, $remotefeed);
if ($xml) {
echo '<h3>Current Weather</h3>';
echo '<img src=' . $iconspath . $xml->icon_url_name . ' alt=" ">';
echo '<h2>' . $xml->temp_f . '° F</h2>';
echo '<p>' . $xml->weather . '</p>';
echo '<br/>';
echo '<ul>';
echo '<li><strong>Wind Chill (°F): </strong>' . $xml->windchill_f . '</li>';
echo '<li><strong>Heat Index (°F): </strong>' . $xml->heat_index_f . '</li>';
echo '<li><strong>Humidity: </strong>' . $xml->relative_humidity . '%</li>';
echo '<li><strong>Wind: </strong>' . $xml->wind_string . '</li>';
echo '<li><strong>Pressure: </strong>' . $xml->pressure_in . '</li>';
echo '<li><strong>Dewpoint: </strong>' . $xml->dewpoint_f . '</li>';
echo '</ul>';
echo '<p><em>' . $xml->observation_time . '</em></p>';
echo '<p><a href="http://www.crh.noaa.gov/forecast/MapClick.php?CityName=Aurora&state=IL&site=LOT">view forecast</a></p>';
} else {
echo "Could not load weather data.";
}
?>
</body>
</html>