diff options
| author | schneefux <schneefux+commit@schneefux.xyz> | 2014-04-09 19:44:11 +0100 |
|---|---|---|
| committer | schneefux <schneefux+commit@schneefux.xyz> | 2014-04-09 19:44:11 +0100 |
| commit | 2b129def696ac5ef6cc28f6c8d7b3dea86442337 (patch) | |
| tree | c0fc8723e57d8ac1894d86900fee258557650f92 /client | |
| parent | f419f389ea563bded70b88b86d3db54d93d5adca (diff) | |
| download | jasper-client-2b129def696ac5ef6cc28f6c8d7b3dea86442337.tar.gz jasper-client-2b129def696ac5ef6cc28f6c8d7b3dea86442337.zip | |
Weather module parses global forecasts correctly
The weather module now checks to see if it is a global forecast, as the
parsing needs to be slightly different if so
Diffstat (limited to 'client')
| -rw-r--r-- | client/modules/Weather.py | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/client/modules/Weather.py b/client/modules/Weather.py index 85a8f1d..7bb86ec 100644 --- a/client/modules/Weather.py +++ b/client/modules/Weather.py @@ -76,12 +76,18 @@ def handle(text, mic, profile): for entry in forecast: try: date_desc = entry['title'].split()[0].strip().lower() + if date_desc == 'forecast': #For global forecasts + date_desc = entry['title'].split()[2].strip().lower() + weather_desc = entry['summary'] - weather_desc = entry['summary'].split('-')[1] + elif date_desc == 'current': #For first item of global forecasts + continue + else: + weather_desc = entry['summary'].split('-')[1] #US forecasts if weekday == date_desc: output = date_keyword + \ - ", the weather will be" + weather_desc + "." + ", the weather will be " + weather_desc + "." break except: continue |
