logo

searx

My custom branche(s) on searx, a meta-search engine git clone https://hacktivis.me/git/searx.git
commit: 922565c8a9f1061c8f6bcfa2ea8a11667d111c7c
parent 4578575c284584a58cce0acd85f86bef2f49d77f
Author: a01200356 <a01200356@itesm.mx>
Date:   Sat, 26 Dec 2015 22:26:59 -0600

Returns answer rather than results.

More appropriate in this case because it will always give just one
answer.

Diffstat:

Msearx/engines/wolframalpha_api.py9+++------
1 file changed, 3 insertions(+), 6 deletions(-)

diff --git 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 = '<iframe width="540" height="304" ' +\ -# 'data-src="//www.youtube-nocookie.com/embed/{videoid}" ' +\ -# 'frameborder="0" allowfullscreen></iframe>' - # 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