make the icon using the image proxy

This commit is contained in:
Tobias Diekershoff 2015-07-17 16:57:58 +02:00
parent 7c6ae901d9
commit d25a0f6d72
2 changed files with 4 additions and 3 deletions

View file

@ -10,7 +10,8 @@
*/ */
require_once('include/network.php'); 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 // get the weather data from OpenWeatherMap
function getWeather( $loc, $units='metric', $lang='en', $appid='', $cachetime=0) { function getWeather( $loc, $units='metric', $lang='en', $appid='', $cachetime=0) {
@ -108,7 +109,7 @@ function curweather_network_mod_init(&$fk_app,&$b) {
$t = get_markup_template("widget.tpl", "addon/curweather/" ); $t = get_markup_template("widget.tpl", "addon/curweather/" );
$curweather = replace_macros ($t, array( $curweather = replace_macros ($t, array(
'$title' => t("Current Weather"), '$title' => t("Current Weather"),
'$icon' => $res['icon'], '$icon' => proxy_url('http://openweathermap.org/img/w/'.$res['icon'].'.png'),
'$city' => $res['city'], '$city' => $res['city'],
'$lon' => $res['lon'], '$lon' => $res['lon'],
'$lat' => $res['lat'], '$lat' => $res['lat'],

View file

@ -3,7 +3,7 @@
<h4 title="{{$lastupdate}}">{{$title}}: {{$city}}</h4> <h4 title="{{$lastupdate}}">{{$title}}: {{$city}}</h4>
</div> </div>
<p> <p>
<img src="http://openweathermap.org/img/w/{{$icon}}.png" title="{{$description}}"> <img src="{{$icon}}" title="{{$description}}">
<ul class="curweather-details"> <ul class="curweather-details">
<li><strong>{{$temp}}</strong></li> <li><strong>{{$temp}}</strong></li>
<li>{{$relhumidity['caption']}}: {{$relhumidity['val']}}</li> <li>{{$relhumidity['caption']}}: {{$relhumidity['val']}}</li>