From 922565c8a9f1061c8f6bcfa2ea8a11667d111c7c Mon Sep 17 00:00:00 2001 From: a01200356 Date: Sat, 26 Dec 2015 22:26:59 -0600 Subject: [PATCH] Returns answer rather than results. More appropriate in this case because it will always give just one answer. --- searx/engines/wolframalpha_api.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/searx/engines/wolframalpha_api.py b/searx/engines/wolframalpha_api.py index 1cf908b6..8390e91f 100644 --- a/searx/engines/wolframalpha_api.py +++ b/searx/engines/wolframalpha_api.py @@ -18,16 +18,12 @@ base_url = 'http://api.wolframalpha.com/v2/query' search_url = base_url + '?appid={api_key}&{query}&format=plaintext' site_url = 'http://wolframalpha.com/input/?{query}' -#embedded_url = '' - # do search-request def request(query, params): params['url'] = search_url.format(query=urlencode({'input': query}), api_key=api_key) - # need this for url in response + need this for url in response global my_query my_query = query @@ -63,8 +59,9 @@ def response(resp): result_url = site_url.format(query=urlencode({'i': my_query})) # append result + # TODO: shouldn't it bind the source too? results.append({'url': result_url, - 'title': result}) + 'answer': result}) # return results return results