From 25116e20f99d4fd68f0fd431710c8327ea3470d0 Mon Sep 17 00:00:00 2001 From: stoneLeaf Date: Thu, 12 Apr 2012 03:41:35 +0200 Subject: [PATCH] Fixed the suggest plugin The API get request needed to be tweaked. --- plugins/suggest.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/suggest.py b/plugins/suggest.py index f3e69bc..3d30195 100644 --- a/plugins/suggest.py +++ b/plugins/suggest.py @@ -19,7 +19,7 @@ def suggest(inp, inp_unstripped=''): else: num = 0 - page = http.get('http://google.com/complete/search', q=inp) + page = http.get('http://google.com/complete/search', output='json', client='hp', q=inp) page_json = page.split('(', 1)[1][:-1] suggestions = json.loads(page_json)[1] if not suggestions: @@ -30,4 +30,4 @@ def suggest(inp, inp_unstripped=''): out = suggestions[num - 1] else: out = random.choice(suggestions) - return '#%d: %s' % (int(out[2][0]) + 1, out[0]) + return '#%d: %s' % (int(out[2][0]) + 1, out[0].replace('', '').replace('', ''))