summaryrefslogtreecommitdiff
path: root/widgets/weather
diff options
context:
space:
mode:
Diffstat (limited to 'widgets/weather')
-rw-r--r--widgets/weather/GetLatLangFromCity.php4
-rw-r--r--widgets/weather/README6
-rw-r--r--widgets/weather/update_weather.config17
-rw-r--r--widgets/weather/update_weather.config.sample23
-rw-r--r--widgets/weather/update_weather.php2
5 files changed, 31 insertions, 21 deletions
diff --git a/widgets/weather/GetLatLangFromCity.php b/widgets/weather/GetLatLangFromCity.php
index e05c1bc8..1ca7d1e3 100644
--- a/widgets/weather/GetLatLangFromCity.php
+++ b/widgets/weather/GetLatLangFromCity.php
@@ -18,8 +18,8 @@ if( !isset($data['results'][0]) ) {
$latitude = $data['results'][0]['geometry']['location']['lat'];
$longitude = $data['results'][0]['geometry']['location']['lng'];
-echo "latitude: ".$latitude."\n";
-echo "longitude: ".$longitude."\n";
+echo "Latitude = ".$latitude."\n";
+echo "Longitude = ".$longitude."\n";
echo "put these values in update_weather.config\n";
?>
diff --git a/widgets/weather/README b/widgets/weather/README
index 956c7a26..af7f985e 100644
--- a/widgets/weather/README
+++ b/widgets/weather/README
@@ -6,4 +6,8 @@ For example call the command from cron.daily.
You need php5 with command line support for this widget. For example in Ubuntu you need the package "php5-cli".
-Please configur your location and others in update_weather.config. Use php-script "GetLatLangFromCity.php" to get latitude & longitude from your location.
+Please move update_weather.config to update_weather.config.sample
+
+mv update_weather.config.sample update_weather.config
+
+Configure your location and others in update_weather.config. Use php-script "GetLatLangFromCity.php" to get latitude & longitude from your location.
diff --git a/widgets/weather/update_weather.config b/widgets/weather/update_weather.config
deleted file mode 100644
index f799c6d3..00000000
--- a/widgets/weather/update_weather.config
+++ /dev/null
@@ -1,17 +0,0 @@
-[main]
-# use GetLatLangFromCity.php to get latitude/langitude
-Latitude = 52.5200066
-Longitude = 13.404954
-# location shown in Skin
-LocationSkin = "Berlin"
-# Can be set to 'us', 'si', 'ca', 'uk' or 'auto' (see forecast.io API); default is auto
-Units = "si"
-DegreeSign = "°C"
-# Can be set to 'en', 'de', 'pl', 'es', 'fr', 'it', 'tet' or 'x-pig-latin' (see forecast.io API); default is 'en'
-Lang = "de"
-# convert . to , for german format
-ConvertPoint2Comma = 1
-# We have only 1000 api calls per day, so please only do one update per day!
-# Or request an own key for free at forecast.io
-ApiKey = "137f2d85a1f1db5762e5e073103541d2"
-
diff --git a/widgets/weather/update_weather.config.sample b/widgets/weather/update_weather.config.sample
new file mode 100644
index 00000000..f913d89f
--- /dev/null
+++ b/widgets/weather/update_weather.config.sample
@@ -0,0 +1,23 @@
+[main]
+
+; use GetLatLangFromCity.php to get latitude/langitude
+Latitude = 52.5200066
+Longitude = 13.404954
+
+; location shown in Skin
+LocationSkin = "Berlin"
+
+; Can be set to 'us', 'si', 'ca', 'uk' or 'auto' (see forecast.io API); default is auto
+Units = "si"
+DegreeSign = "°C"
+
+; Can be set to 'en', 'de', 'pl', 'es', 'fr', 'it', 'tet' or 'x-pig-latin' (see forecast.io API); default is 'en'
+Lang = "de"
+
+; convert . to , for german format
+ConvertPoint2Comma = 1
+
+; We have only 1000 api calls per day, so please only do one update per day!
+; Or request an own key for free at forecast.io
+ApiKey = "137f2d85a1f1db5762e5e073103541d2"
+
diff --git a/widgets/weather/update_weather.php b/widgets/weather/update_weather.php
index a35e89f4..4b4dbb86 100644
--- a/widgets/weather/update_weather.php
+++ b/widgets/weather/update_weather.php
@@ -71,9 +71,9 @@ foreach($conditions_week as $conditions) {
continue;
}
// we only have min & max so we must calc
+ $temp = round($conditions->getMaxTemperature(), 1);
if( $convertPoint == 1 )
$temp = str_replace(".", ",", $temp);
- $temp = round($conditions->getMaxTemperature(), 1);
fwrite($handle, $temp);
fwrite($handle, $degree_sign);
fclose($handle);