-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsummary.php
executable file
·43 lines (35 loc) · 1.33 KB
/
summary.php
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
43
<?PHP
////////////////////////////////////////////////////
//
// WeatherOffice
//
// http://www.sourceforge.net/projects/weatheroffice
//
// Copyright (C) 04/2007 Mathias Zuckermann &
// Bernhard Heibler
//
// See COPYING for license info
//
////////////////////////////////////////////////////
include("weatherInclude.php");
$timestamp = $database->getWeatherLastDate();
$database->free();
$values = $database->getWeatherFromDate($timestamp);
$database->free();
$day = substr($timestamp, 6, 2);
$month = substr($timestamp, 4, 2);
$year = substr($timestamp, 0, 4);
$hour = substr($timestamp, 8, 2);
$minute = substr($timestamp, 10, 2);
$second = substr($timestamp, 12, 4);
$windkmh = $values['windspeed']*3.6;
$database->close();
header("Content-type: text/xml");
// Microsummary for Firefox 2.0 Bookmarks http://wiki.mozilla.org/Microsummaries
echo"<?xml version=\"1.0\" encoding=\"UTF-8\"?>";
echo"<generator xmlns=\"http://www.mozilla.org/microsummaries/0.1\" name=\"Weather Info\">";
echo"<template><transform xmlns=\"http://www.w3.org/1999/XSL/Transform\" version=\"1.0\"><output method=\"text\"/><template match=\"/\">";
echo"<text>$STATION_NAME: $values[temp_out]C $windkmh km/h - $hour:$minute</text>";
echo"</template></transform></template>";
echo "</generator>";
?>