buncha stuff
This commit is contained in:
@@ -8,27 +8,26 @@ API_KEY = "99631af2d6db903d1f689c7d2cb13764"
|
||||
CITY_ID = "5809844"
|
||||
UNITS = "metric"
|
||||
|
||||
|
||||
def celsius_to_fahrenheit(celsius):
|
||||
return (celsius * 9 / 5) + 32
|
||||
|
||||
|
||||
def get_weather_icon(description):
|
||||
icons = {
|
||||
"clear sky": "",
|
||||
"few clouds": "",
|
||||
"scattered clouds": "",
|
||||
"broken clouds": "",
|
||||
"overcast clouds": "",
|
||||
"shower rain": "",
|
||||
"light rain": "",
|
||||
"rain": "",
|
||||
"moderate rain": "",
|
||||
"thunderstorm": "",
|
||||
"snow": "",
|
||||
"mist": "",
|
||||
"haze": "",
|
||||
"smoke": ""
|
||||
"clear sky": "☀️",
|
||||
"few clouds": "🌤️",
|
||||
"scattered clouds": "🌥️",
|
||||
"broken clouds": "☁️",
|
||||
"overcast clouds": "☁️",
|
||||
"shower rain": "🌦️",
|
||||
"light rain": "🌧️",
|
||||
"rain": "🌧️",
|
||||
"moderate rain": "🌧️",
|
||||
"thunderstorm": "⛈️",
|
||||
"snow": "❄️",
|
||||
"mist": "🌫️",
|
||||
"haze": "🌫️",
|
||||
"smoke": "🌫️",
|
||||
}
|
||||
return icons.get(description, "❓")
|
||||
|
||||
@@ -39,6 +38,7 @@ try:
|
||||
)
|
||||
response.raise_for_status()
|
||||
weather_data = response.json()
|
||||
#print(weather_data)
|
||||
|
||||
weather_desc = weather_data["weather"][0]["description"]
|
||||
#print(weather_desc)
|
||||
|
||||
Reference in New Issue
Block a user