[% uri_base = request.uri_base %]
[% USE date; USE DataPrinter; # DataPrinter.dump_html(settings); forecast_data = data.forecast.data; # DataPrinter.dump_html(forecast_data); weather_data = data.weather.data; # DataPrinter.dump_html(weather_data); # DataPrinter.dump_html(data.weather.result); # DataPrinter.dump_html(data.forecast.result); %] [% # DataPrinter.dump_html(request.uri) %]ERROR: [% weather_data.message %] [[% params.city.ucfirst %], [% params.country.upper %]]
[% ELSE %]| Temperature | [% min_temp = weather_data.main.temp_min | format('%.1f'); max_temp = weather_data.main.temp_max | format('%.1f'); avg_temp = weather_data.main.temp | format('%.1f'); %][% avg_temp %]oC [[% min_temp; ' - '; max_temp %]] |
|---|---|
| Wind speed | [% weather_data.wind.deg | format("%.0f") %]o @ [% weather_data.wind.speed * 2.23694 | format("%.0f") -%] [%- IF weather_data.wind.gust; 'G'; weather_data.wind.gust * 2.23694 | format("%.0f") %] [% END %] mph |
| Pressure | [% weather_data.main.pressure %] hPa |
| Cloud cover | [% weather_data.clouds.all %]% |
| Visibility | [% weather_data.visibility %] mtr |
| Humidity | [% weather_data.main.humidity %]% |
| Sunrise | [% date.format(weather_data.sys.sunrise, '%H:%M') %]Z |
| Sunset | [% date.format(weather_data.sys.sunset, '%H:%M') %]Z |
| Date/Time | Summary | Temperature | Wind speed | |
|---|---|---|---|---|
| [% date.format(entry.dt_txt, '%a %d %b %Y %l%P') .replace('12am','midnight') .replace('12pm','midday') %] |
|
[% entry.weather.0.description %] | [% min_temp = entry.main.temp_min | format('%.1f'); max_temp = entry.main.temp_max | format('%.1f'); avg_temp = entry.main.temp | format('%.1f'); class = min_temp < 1 OR entry.main.temp < 1 ? 'cold' : 'normal'; %][% IF min_temp != max_temp; min_temp; ' - '; max_temp; ELSE; avg_temp; END -%]oC | [% entry.wind.speed * 2.23694 | format("%.0f") -%] [%- IF entry.wind.gust; 'G'; entry.wind.gust * 2.23694 | format("%.0f") %] [% END %] mph |