*/
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) {
'humidity' => (string) $res->humidity['value'].(string)$res->humidity['unit'],
'descripion' => $desc,
'wind' => (string)$res->wind->speed['name'].' ('.(string)$res->wind->speed['value'].$wunit.')',
- 'update' => (string)$res->lastupdate['value']
+ 'update' => (string)$res->lastupdate['value'],
+ '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;
}
$t = get_markup_template("widget.tpl", "addon/curweather/" );
$curweather = replace_macros ($t, array(
'$title' => t("Current Weather"),
+ '$icon' => proxy_url('http://openweathermap.org/img/w/'.$res['icon'].'.png'),
'$city' => $res['city'],
'$lon' => $res['lon'],
'$lat' => $res['lat'],