From 7bcaf1e4da3ae4d2f583743de6ec9b8415c2627c Mon Sep 17 00:00:00 2001
From: swee <meow@swee.codes>
Date: Sat, 15 Mar 2025 16:08:51 -0700
Subject: [PATCH] Update cc/weather

---
 cc/weather | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)

diff --git a/cc/weather b/cc/weather
index e0c8cb3..d09ac25 100644
--- a/cc/weather
+++ b/cc/weather
@@ -3,28 +3,30 @@ if not "WAPIKEY" in os.environ:
     print("MeowNexUS requires the WAPIKEY environment variable for this command to function. get one from https://weatherapi.com/")
     sys.exit(1)
 query = requests.get("http://api.weatherapi.com/v1/current.json?key=" + os.environ["WAPIKEY"] + "&q=" + " ".join(sys.argv[3:])).json()
+weathers_global {
+    **dict.fromkeys([1063, 1150, 1153, 1180, 1183, 1186, 1189, 1192, 1195, 1198, 1201, 1204, 1207, 1240, 1243, 1246, 1249, 1252], "🌧️"),
+    **dict.fromkeys([1066, 1069, 1072, 1114, 1210, 1213, 1216, 1219, 1222, 1225, 1255, 1258, 1237], "🌨️"),
+    **dict.fromkeys([1030, 1135, 1147], "🌫️"),
+    **dict.fromkeys([1087, 1273, 1276, 1279, 1282], "⛈️")
+}
 weathers = {
     1: {
         1000: "☀️",
         1003: "⛅",
         1006: "☁️",
         1009: "☁️",
-        1030: "🌫️",
         1063: "🌦️",
-        **dict.fromkeys([1063, 1150, 1153, 1180, 1183, 1186, 1189, 1192, 1195, 1198, 1201, 1204, 1207, 1240, 1243, 1246, 1249, 1252], "🌧️"),
-        **dict.fromkeys([1063, 1150, 1153], "🌨️")
+        **weathers_global
     },
     0: {
         1000: "🌙",
         1003: "☁️",
         1006: "☁️",
         1009: "☁️",
-        1030: "🌫️",
-        **dict.fromkeys([1063, 1150, 1153, 1180, 1183, 1186, 1189, 1192, 1195, 1198, 1201, 1204, 1207, 1240, 1243, 1246, 1249, 1252], "🌧️"),
-        **dict.fromkeys([1063, 1150, 1153], "🌨️")
+        **weathers_global
     }
 }
 if "error" in query:
     print("API ERROR: " + query["error"]["message"])
 else:
-    print("")
\ No newline at end of file
+    print(query["location"]["name"] + ", " + query["location"]["region"] + ", " + query["location"]["country"] + ": " + weathers[query["current"]["is_day"]][query["current"]["condition"]["code"]] + " " + query["current"]["condition"]["text"] + " " + str(query["current"]["temp_c"]) + "°F" + "(" + str(query["current"]["temp_c"]) + "°C)")
\ No newline at end of file