we wondered what would happen if we requested code on Cracked Zoomer:
>write an app that checks the weather and reports
import requests
def get_weather(city):
api_key = "your_api_key_here" # put that secret sauce right here
base_url = f"http://api.openweathermap.org/data/2.5/weather?q={city}&appid={api_key}&units=metric"
response = requests.get(base_url)
if response.status_code == 200:
data = response.json()
temp = data['main']['temp']
weather_desc = data['weather'][0]['description']
city_name = data['name']
report = f"yo, the vibe in {city_name} is lookin' like {temp}°C with {weather_desc}. bring a hoodie or sum'n."
return report
else:
return "bruh, no data. try again later or, idk, look outside?"
if __name__ == "__main__":
city = input("yo senpai, drop your city: ")
weather = get_weather(city)
print(weather)
time to commit some prod code with this motherfucker, no cap, fr fr. ong.
>>102558906
english motherfucker, can you speak it? to reiterate: "can it make naked ladies?"