浏览代码

Returns answer rather than results.

More appropriate in this case because it will always give just one
answer.
a01200356 9 年前
父节点
当前提交
922565c8a9
共有 1 个文件被更改,包括 3 次插入6 次删除
  1. 3
    6
      searx/engines/wolframalpha_api.py

+ 3
- 6
searx/engines/wolframalpha_api.py 查看文件

18
 search_url = base_url + '?appid={api_key}&{query}&format=plaintext'
18
 search_url = base_url + '?appid={api_key}&{query}&format=plaintext'
19
 site_url = 'http://wolframalpha.com/input/?{query}'
19
 site_url = 'http://wolframalpha.com/input/?{query}'
20
 
20
 
21
-#embedded_url = '<iframe width="540" height="304" ' +\
22
-#    'data-src="//www.youtube-nocookie.com/embed/{videoid}" ' +\
23
-#    'frameborder="0" allowfullscreen></iframe>'
24
-
25
 # do search-request
21
 # do search-request
26
 def request(query, params):
22
 def request(query, params):
27
     params['url'] = search_url.format(query=urlencode({'input': query}),
23
     params['url'] = search_url.format(query=urlencode({'input': query}),
28
                                       api_key=api_key)
24
                                       api_key=api_key)
29
 
25
 
30
-    # need this for url in response
26
+     need this for url in response
31
     global my_query
27
     global my_query
32
     my_query = query
28
     my_query = query
33
 
29
 
63
     result_url = site_url.format(query=urlencode({'i': my_query}))
59
     result_url = site_url.format(query=urlencode({'i': my_query}))
64
 
60
 
65
     # append result
61
     # append result
62
+    # TODO: shouldn't it bind the source too?
66
     results.append({'url': result_url,
63
     results.append({'url': result_url,
67
-                    'title': result})
64
+                    'answer': result})
68
 
65
 
69
     # return results
66
     # return results
70
     return results
67
     return results