@@ -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−'''