From 75760892a5458ecdb1782824e1c5a83c09554891 Mon Sep 17 00:00:00 2001 From: SpudGunMan Date: Thu, 20 Jun 2024 00:36:07 -0700 Subject: [PATCH] Update locationdata.py --- locationdata.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/locationdata.py b/locationdata.py index f753142..1c75211 100644 --- a/locationdata.py +++ b/locationdata.py @@ -94,10 +94,13 @@ def get_weather(lat=0, lon=0): line = line.replace("North", "N").replace("South", "S").replace("East", "E").replace("West", "W") line = line.replace("precipitation", "precip").replace("showers", "shwrs").replace("thunderstorms", "t-storms") #only grab a few days of weather - if len(weather.split("\n")) < 4: + if len(weather.split("\n")) < 3: weather += line + "\n" #trim off last newline weather = weather[:-1] + #trim to 200 characters + if len(weather) > 200: + weather = weather[:200] return weather