]> git.mxchange.org Git - friendica-addons.git/blobdiff - curweather/curweather.php
Twitter: The sync process is split into several short processes
[friendica-addons.git] / curweather / curweather.php
index 88eee9c9713acccfd6f0ec32836517d2164aec2f..71d95e4640cb2fd8443786b1047ef4dd604ba497 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'],
@@ -157,7 +158,7 @@ function curweather_plugin_settings(&$a,&$s) {
        $curweather_units = get_pconfig(local_user(), 'curweather', 'curweather_units');
        $appid = get_config('curweather','appid');
        if ($appid=="") { 
-               $noappidtext = t('No APPID found, please contact your admin to optain one.');
+               $noappidtext = t('No APPID found, please contact your admin to obtain one.');
        } else {
            $noappidtext = '';
        }
@@ -172,7 +173,7 @@ function curweather_plugin_settings(&$a,&$s) {
                '$noappidtext' => $noappidtext,
                '$info' => t('Enter either the name of your location or the zip code.'),
                '$curweather_loc' => array( 'curweather_loc', t('Your Location'), $curweather_loc, t('Identifier of your location (name or zip code), e.g. <em>Berlin,DE</em> or <em>14476,DE</em>.') ),
-               '$curweather_units' => array( 'curweather_units', t('Units'), $curweather_units, t('select if the temperatur should be displayed in °C or °F'), array('metric'=>'°C', 'imperial'=>'°F')),
+               '$curweather_units' => array( 'curweather_units', t('Units'), $curweather_units, t('select if the temperature should be displayed in &deg;C or &deg;F'), array('metric'=>'°C', 'imperial'=>'°F')),
                '$enabled' => array( 'curweather_enable', t('Show weather data'), $enable, '')
            ));
        return;