From 54a79b7ab07e8f0dd9d79af0911bd2fb2544054d Mon Sep 17 00:00:00 2001 From: spline Date: Thu, 18 Jul 2013 15:44:08 -0400 Subject: [PATCH] Fix alerts problem with parsing JSON. --- plugin.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugin.py b/plugin.py index 8d8324f..9fcb2b1 100644 --- a/plugin.py +++ b/plugin.py @@ -562,7 +562,7 @@ class Weather(callbacks.Plugin): # handle alerts if args['alerts']: # only look for alerts if there. if data['alerts']: # alerts is a list. it can also be empty. - outdata['alerts'] = data['alerts']['message'] # need to do some formatting below. + outdata['alerts'] = data['alerts'][0]['message'] # need to do some formatting below. outdata['alerts'] = outdata['alerts'].replace('\n', ' ')[:300] # \n->' ' and max 300 chars. outdata['alerts'] = utils.str.normalizeWhitespace(outdata['alerts']) # fix pesky double whitespacing. else: # no alerts found (empty).