From 0b862625606114e901a0aea904ed2b82d753e80d Mon Sep 17 00:00:00 2001 From: Chris Cummer Date: Thu, 29 Mar 2018 03:34:36 -0700 Subject: [PATCH] More weather emoji --- weather/widget.go | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/weather/widget.go b/weather/widget.go index 86c10e39..f440074d 100644 --- a/weather/widget.go +++ b/weather/widget.go @@ -30,6 +30,7 @@ func Widget() tview.Primitive { } // icon returns an emoji for the current weather +// src: https://github.com/chubin/wttr.in/blob/master/share/translations/en.txt func icon(data *owm.CurrentWeatherData) string { var icon string @@ -39,11 +40,19 @@ func icon(data *owm.CurrentWeatherData) string { case "cloudy": icon = "⛅️" case "heavy rain": - icon = "🌧" + icon = "💦" + case "heavy snow": + icon = "⛄️" + case "light intensity shower rain": + icon = "☔️" case "light rain": - icon = "🌧" + icon = "🌦" + case "light snow": + icon = "🌨" case "moderate rain": icon = "🌧" + case "moderate snow": + icon = "🌨" case "overcast": icon = "🌥" case "overcast clouds": @@ -55,7 +64,7 @@ func icon(data *owm.CurrentWeatherData) string { case "sunny": icon = "☀️" default: - icon = "🌈" + icon = "💥" } return icon