on master help sign in
Remove non API version (doesn't work)
commitb3fde19ed59c6e05b1f076ea1f8a7cec21229083 authora01200356 <a01200356@itesm.mx> dateSun 27 Dec 2015, 21:09 (11 years ago) parent922565c
2 files changed+1−61
searx/engines/wolframalpha.py−60 searx/engines/wolframalpha_api.py+1−1
searx/engines/wolframalpha.pydeleted−60
@@ -1,60 +0,0 @@
1−"""
2− WolframAlpha
3−
4− @website http://www.wolframalpha.com/
5−
6− @using-api yes
7− @results no c
8− @stable i guess so
9− @parse result
10−"""
11−
12−import wolframalpha
13−
14−# engine dependent config
15−paging = False
16−
17−# search-url
18−# url = 'http://www.wolframalpha.com/'
19−# search_url = url+'input/?{query}'
20−
21−client_id = '5952JX-X52L3VKWT8'
22−'''
23−# do search-request
24−def request(query, params):
25− params['url'] = search_url.format(query=urlencode({'i': query}))
26− print params
27−
28− return params
29−
30−
31−# get response from search-request
32−def response(resp):
33− print resp
34−
35− dom = html.fromstring(resp.text)
36− #resshit = dom.find_class('output pnt')
37− #for shit in resshit:
38− #print shit.text_content()
39− results = []
40− #results.append({'url': 'https://wikipedia.org', 'title': 'Wolfie, lol', 'content': 'es kwatro'})
41− #print results
42− #return results
43−
44− # parse results
45− for result in dom.xpath(results_xpath):
46− print result
47−
48− link = result.xpath(link_xpath)[0]
49− href = urljoin(url, link.attrib.get('href'))
50− title = escape(extract_text(link))
51− content = escape(extract_text(result.xpath(content_xpath)))
52−
53− # append result
54− results.append({'url': href,
55− 'title': title,
56− 'content': content})
57−
58− print results
59− return results
60−'''
searx/engines/wolframalpha_api.py+1−1
@@ -23,7 +23,7 @@ def request(query, params):
2323 params['url'] = search_url.format(query=urlencode({'input': query}),
2424 api_key=api_key)
2525
26− need this for url in response
26+ # need this for url in response
2727 global my_query
2828 my_query = query
2929