mirror of
https://github.com/chubin/wttr.in
synced 2025-01-12 12:08:47 +00:00
187 lines
6.2 KiB
Go
187 lines
6.2 KiB
Go
package main
|
||
|
||
var (
|
||
iconUnknown = []string{
|
||
" .-. ",
|
||
" __) ",
|
||
" ( ",
|
||
" `-’ ",
|
||
" • "}
|
||
|
||
iconSunny = []string{
|
||
"\033[38;5;226m \\ / \033[0m",
|
||
"\033[38;5;226m .-. \033[0m",
|
||
"\033[38;5;226m ― ( ) ― \033[0m",
|
||
"\033[38;5;226m `-’ \033[0m",
|
||
"\033[38;5;226m / \\ \033[0m"}
|
||
|
||
iconPartlyCloudy = []string{
|
||
"\033[38;5;226m \\ /\033[0m ",
|
||
"\033[38;5;226m _ /\"\"\033[38;5;250m.-. \033[0m",
|
||
"\033[38;5;226m \\_\033[38;5;250m( ). \033[0m",
|
||
"\033[38;5;226m /\033[38;5;250m(___(__) \033[0m",
|
||
" "}
|
||
|
||
iconCloudy = []string{
|
||
" ",
|
||
"\033[38;5;250m .--. \033[0m",
|
||
"\033[38;5;250m .-( ). \033[0m",
|
||
"\033[38;5;250m (___.__)__) \033[0m",
|
||
" "}
|
||
|
||
iconVeryCloudy = []string{
|
||
" ",
|
||
"\033[38;5;240;1m .--. \033[0m",
|
||
"\033[38;5;240;1m .-( ). \033[0m",
|
||
"\033[38;5;240;1m (___.__)__) \033[0m",
|
||
" "}
|
||
|
||
iconLightShowers = []string{
|
||
"\033[38;5;226m _`/\"\"\033[38;5;250m.-. \033[0m",
|
||
"\033[38;5;226m ,\\_\033[38;5;250m( ). \033[0m",
|
||
"\033[38;5;226m /\033[38;5;250m(___(__) \033[0m",
|
||
"\033[38;5;111m ‘ ‘ ‘ ‘ \033[0m",
|
||
"\033[38;5;111m ‘ ‘ ‘ ‘ \033[0m"}
|
||
|
||
iconHeavyShowers = []string{
|
||
"\033[38;5;226m _`/\"\"\033[38;5;240;1m.-. \033[0m",
|
||
"\033[38;5;226m ,\\_\033[38;5;240;1m( ). \033[0m",
|
||
"\033[38;5;226m /\033[38;5;240;1m(___(__) \033[0m",
|
||
"\033[38;5;21;1m ‚‘‚‘‚‘‚‘ \033[0m",
|
||
"\033[38;5;21;1m ‚’‚’‚’‚’ \033[0m"}
|
||
|
||
iconLightSnowShowers = []string{
|
||
"\033[38;5;226m _`/\"\"\033[38;5;250m.-. \033[0m",
|
||
"\033[38;5;226m ,\\_\033[38;5;250m( ). \033[0m",
|
||
"\033[38;5;226m /\033[38;5;250m(___(__) \033[0m",
|
||
"\033[38;5;255m * * * \033[0m",
|
||
"\033[38;5;255m * * * \033[0m"}
|
||
|
||
iconHeavySnowShowers = []string{
|
||
"\033[38;5;226m _`/\"\"\033[38;5;240;1m.-. \033[0m",
|
||
"\033[38;5;226m ,\\_\033[38;5;240;1m( ). \033[0m",
|
||
"\033[38;5;226m /\033[38;5;240;1m(___(__) \033[0m",
|
||
"\033[38;5;255;1m * * * * \033[0m",
|
||
"\033[38;5;255;1m * * * * \033[0m"}
|
||
|
||
iconLightSleetShowers = []string{
|
||
"\033[38;5;226m _`/\"\"\033[38;5;250m.-. \033[0m",
|
||
"\033[38;5;226m ,\\_\033[38;5;250m( ). \033[0m",
|
||
"\033[38;5;226m /\033[38;5;250m(___(__) \033[0m",
|
||
"\033[38;5;111m ‘ \033[38;5;255m*\033[38;5;111m ‘ \033[38;5;255m* \033[0m",
|
||
"\033[38;5;255m *\033[38;5;111m ‘ \033[38;5;255m*\033[38;5;111m ‘ \033[0m"}
|
||
|
||
iconThunderyShowers = []string{
|
||
"\033[38;5;226m _`/\"\"\033[38;5;250m.-. \033[0m",
|
||
"\033[38;5;226m ,\\_\033[38;5;250m( ). \033[0m",
|
||
"\033[38;5;226m /\033[38;5;250m(___(__) \033[0m",
|
||
"\033[38;5;228;5m ⚡\033[38;5;111;25m‘‘\033[38;5;228;5m⚡\033[38;5;111;25m‘‘ \033[0m",
|
||
"\033[38;5;111m ‘ ‘ ‘ ‘ \033[0m"}
|
||
|
||
iconThunderyHeavyRain = []string{
|
||
"\033[38;5;240;1m .-. \033[0m",
|
||
"\033[38;5;240;1m ( ). \033[0m",
|
||
"\033[38;5;240;1m (___(__) \033[0m",
|
||
"\033[38;5;21;1m ‚‘\033[38;5;228;5m⚡\033[38;5;21;25m‘‚\033[38;5;228;5m⚡\033[38;5;21;25m‚‘ \033[0m",
|
||
"\033[38;5;21;1m ‚’‚’\033[38;5;228;5m⚡\033[38;5;21;25m’‚’ \033[0m"}
|
||
|
||
iconThunderySnowShowers = []string{
|
||
"\033[38;5;226m _`/\"\"\033[38;5;250m.-. \033[0m",
|
||
"\033[38;5;226m ,\\_\033[38;5;250m( ). \033[0m",
|
||
"\033[38;5;226m /\033[38;5;250m(___(__) \033[0m",
|
||
"\033[38;5;255m *\033[38;5;228;5m⚡\033[38;5;255;25m*\033[38;5;228;5m⚡\033[38;5;255;25m* \033[0m",
|
||
"\033[38;5;255m * * * \033[0m"}
|
||
|
||
iconLightRain = []string{
|
||
"\033[38;5;250m .-. \033[0m",
|
||
"\033[38;5;250m ( ). \033[0m",
|
||
"\033[38;5;250m (___(__) \033[0m",
|
||
"\033[38;5;111m ‘ ‘ ‘ ‘ \033[0m",
|
||
"\033[38;5;111m ‘ ‘ ‘ ‘ \033[0m"}
|
||
|
||
iconHeavyRain = []string{
|
||
"\033[38;5;240;1m .-. \033[0m",
|
||
"\033[38;5;240;1m ( ). \033[0m",
|
||
"\033[38;5;240;1m (___(__) \033[0m",
|
||
"\033[38;5;21;1m ‚‘‚‘‚‘‚‘ \033[0m",
|
||
"\033[38;5;21;1m ‚’‚’‚’‚’ \033[0m"}
|
||
|
||
iconLightSnow = []string{
|
||
"\033[38;5;250m .-. \033[0m",
|
||
"\033[38;5;250m ( ). \033[0m",
|
||
"\033[38;5;250m (___(__) \033[0m",
|
||
"\033[38;5;255m * * * \033[0m",
|
||
"\033[38;5;255m * * * \033[0m"}
|
||
|
||
iconHeavySnow = []string{
|
||
"\033[38;5;240;1m .-. \033[0m",
|
||
"\033[38;5;240;1m ( ). \033[0m",
|
||
"\033[38;5;240;1m (___(__) \033[0m",
|
||
"\033[38;5;255;1m * * * * \033[0m",
|
||
"\033[38;5;255;1m * * * * \033[0m"}
|
||
|
||
iconLightSleet = []string{
|
||
"\033[38;5;250m .-. \033[0m",
|
||
"\033[38;5;250m ( ). \033[0m",
|
||
"\033[38;5;250m (___(__) \033[0m",
|
||
"\033[38;5;111m ‘ \033[38;5;255m*\033[38;5;111m ‘ \033[38;5;255m* \033[0m",
|
||
"\033[38;5;255m *\033[38;5;111m ‘ \033[38;5;255m*\033[38;5;111m ‘ \033[0m"}
|
||
|
||
iconFog = []string{
|
||
" ",
|
||
"\033[38;5;251m _ - _ - _ - \033[0m",
|
||
"\033[38;5;251m _ - _ - _ \033[0m",
|
||
"\033[38;5;251m _ - _ - _ - \033[0m",
|
||
" "}
|
||
|
||
codes = map[int][]string{
|
||
113: iconSunny,
|
||
116: iconPartlyCloudy,
|
||
119: iconCloudy,
|
||
122: iconVeryCloudy,
|
||
143: iconFog,
|
||
176: iconLightShowers,
|
||
179: iconLightSleetShowers,
|
||
182: iconLightSleet,
|
||
185: iconLightSleet,
|
||
200: iconThunderyShowers,
|
||
227: iconLightSnow,
|
||
230: iconHeavySnow,
|
||
248: iconFog,
|
||
260: iconFog,
|
||
263: iconLightShowers,
|
||
266: iconLightRain,
|
||
281: iconLightSleet,
|
||
284: iconLightSleet,
|
||
293: iconLightRain,
|
||
296: iconLightRain,
|
||
299: iconHeavyShowers,
|
||
302: iconHeavyRain,
|
||
305: iconHeavyShowers,
|
||
308: iconHeavyRain,
|
||
311: iconLightSleet,
|
||
314: iconLightSleet,
|
||
317: iconLightSleet,
|
||
320: iconLightSnow,
|
||
323: iconLightSnowShowers,
|
||
326: iconLightSnowShowers,
|
||
329: iconHeavySnow,
|
||
332: iconHeavySnow,
|
||
335: iconHeavySnowShowers,
|
||
338: iconHeavySnow,
|
||
350: iconLightSleet,
|
||
353: iconLightShowers,
|
||
356: iconHeavyShowers,
|
||
359: iconHeavyRain,
|
||
362: iconLightSleetShowers,
|
||
365: iconLightSleetShowers,
|
||
368: iconLightSnowShowers,
|
||
371: iconHeavySnowShowers,
|
||
374: iconLightSleetShowers,
|
||
377: iconLightSleet,
|
||
386: iconThunderyShowers,
|
||
389: iconThunderyHeavyRain,
|
||
392: iconThunderySnowShowers,
|
||
395: iconHeavySnowShowers,
|
||
}
|
||
)
|