From efdb12a81dd96d913651b8b2bd5bbcbd8b135cbb Mon Sep 17 00:00:00 2001 From: Martin Schirrmacher Date: Sun, 16 Nov 2014 12:43:30 +0100 Subject: update widgets --- widgets/weather/GetLatLangFromCity.php | 25 ++++++++++++++++++++++ widgets/weather/README | 9 ++++++++ widgets/weather/update_weather.config | 15 ++++++++++++++ widgets/weather/update_weather.php | 38 +++++++++------------------------- 4 files changed, 59 insertions(+), 28 deletions(-) create mode 100644 widgets/weather/GetLatLangFromCity.php create mode 100644 widgets/weather/README create mode 100644 widgets/weather/update_weather.config (limited to 'widgets/weather') diff --git a/widgets/weather/GetLatLangFromCity.php b/widgets/weather/GetLatLangFromCity.php new file mode 100644 index 00000000..e05c1bc8 --- /dev/null +++ b/widgets/weather/GetLatLangFromCity.php @@ -0,0 +1,25 @@ + diff --git a/widgets/weather/README b/widgets/weather/README new file mode 100644 index 00000000..956c7a26 --- /dev/null +++ b/widgets/weather/README @@ -0,0 +1,9 @@ +This widget provide information about weather for a defined location. + +Since the command usually needs long time to execute this is not called from skin flatPlus. +You have to call the command from the system via cron or at system start. +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. diff --git a/widgets/weather/update_weather.config b/widgets/weather/update_weather.config new file mode 100644 index 00000000..4a749212 --- /dev/null +++ b/widgets/weather/update_weather.config @@ -0,0 +1,15 @@ +[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" +# 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 8d2d8be9..d2d38c1e 100644 --- a/widgets/weather/update_weather.php +++ b/widgets/weather/update_weather.php @@ -1,38 +1,20 @@