]> git.mxchange.org Git - friendica-addons.git/blobdiff - curweather/curweather.php
Merge pull request #332 from tobiasd/20151214-translations
[friendica-addons.git] / curweather / curweather.php
index 88eee9c9713acccfd6f0ec32836517d2164aec2f..e28cc2b3044adc6978128aedf631b055199b64fd 100644 (file)
@@ -10,7 +10,8 @@
  */
 
 require_once('include/network.php');
-include_once('include/text.php');
+require_once("mod/proxy.php");
+require_once('include/text.php');
 
 //  get the weather data from OpenWeatherMap
 function getWeather( $loc, $units='metric', $lang='en', $appid='', $cachetime=0) {
@@ -56,7 +57,7 @@ function getWeather( $loc, $units='metric', $lang='en', $appid='', $cachetime=0)
        'icon' => (string)$res->weather['icon']
     );
     set_pconfig(local_user(), 'curweather', 'last', $now->getTimestamp());
-    Cache::set('curweather'.md5($url), serialize($r));
+    Cache::set('curweather'.md5($url), serialize($r), CACHE_HOUR);
     return $r;
 }
 
@@ -108,7 +109,7 @@ function curweather_network_mod_init(&$fk_app,&$b) {
        $t = get_markup_template("widget.tpl", "addon/curweather/" );
        $curweather = replace_macros ($t, array(
            '$title' => t("Current Weather"),
-           '$icon' => $res['icon'],
+           '$icon' => proxy_url('http://openweathermap.org/img/w/'.$res['icon'].'.png'),
            '$city' => $res['city'],
            '$lon' => $res['lon'],
            '$lat' => $res['lat'],