92 if resp.status_code == 404:
95 result = loads(resp.text)
97 current = result[
"current_condition"][0]
98 location = result[
'nearest_area'][0]
100 forecast_indices = {3: gettext(
'Morning'), 4: gettext(
'Noon'), 6: gettext(
'Evening'), 7: gettext(
'Night')}
102 title = f
"{location['areaName'][0]['value']}, {location['region'][0]['value']}"
104 infobox = f
"<h3>{gettext('Current condition')}</h3><table><tbody>"
108 infobox +=
"</tbody></table>"
110 for day
in result[
"weather"]:
111 infobox += f
"<h3>{day['date']}</h3>"
113 infobox +=
"<table><tbody>"
117 infobox +=
"</tbody></table>"
119 infobox +=
"<table><tbody>"
121 for time
in forecast_indices.items():
122 infobox += f
"<tr><td rowspan=\"7\"><b>{time[1]}</b></td></tr>"
126 infobox +=
"</tbody></table>"