diff options
author | a01200356 <a01200356@itesm.mx> | 2016-01-02 00:41:14 -0600 |
---|---|---|
committer | a01200356 <a01200356@itesm.mx> | 2016-01-02 00:41:14 -0600 |
commit | e9d35c1309f05a0b214fb323049909ee7ec62ab8 (patch) | |
tree | c9b8cf6cdb951b66c86c9c55c328456e59cb4042 /searx/engines/wolframalpha_api.py | |
parent | 0871c7ca85cd19a2fa0971c7db28516a74255d5d (diff) | |
download | searxng-e9d35c1309f05a0b214fb323049909ee7ec62ab8.tar.gz searxng-e9d35c1309f05a0b214fb323049909ee7ec62ab8.zip |
update tests for wolframalpha
Diffstat (limited to 'searx/engines/wolframalpha_api.py')
-rw-r--r-- | searx/engines/wolframalpha_api.py | 15 |
1 files changed, 2 insertions, 13 deletions
diff --git a/searx/engines/wolframalpha_api.py b/searx/engines/wolframalpha_api.py index 6927f9707..d4127be4c 100644 --- a/searx/engines/wolframalpha_api.py +++ b/searx/engines/wolframalpha_api.py @@ -14,9 +14,7 @@ from lxml import etree # search-url base_url = 'http://api.wolframalpha.com/v2/query' search_url = base_url + '?appid={api_key}&{query}&format=plaintext' -site_url = 'http://www.wolframalpha.com/input/?{query}' -search_query = '' -api_key = '' +api_key = '' # defined in settings.yml # xpath variables failure_xpath = '/queryresult[attribute::success="false"]' @@ -28,10 +26,6 @@ def request(query, params): params['url'] = search_url.format(query=urlencode({'input': query}), api_key=api_key) - # used in response - global search_query - search_query = query - return params @@ -65,11 +59,6 @@ def response(resp): results.append({'answer': answer}) - # result url - result_url = site_url.format(query=urlencode({'i': search_query})) - - # append result - results.append({'url': result_url, - 'title': search_query + ' - Wolfram|Alpha'}) + # TODO: append a result with title and link, like in the no api version return results |