Explorar el Código

Remove non API version (doesn't work)

a01200356 hace 9 años
padre
commit
b3fde19ed5
Se han modificado 2 ficheros con 1 adiciones y 61 borrados
  1. 0
    60
      searx/engines/wolframalpha.py
  2. 1
    1
      searx/engines/wolframalpha_api.py

+ 0
- 60
searx/engines/wolframalpha.py Ver fichero

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

+ 1
- 1
searx/engines/wolframalpha_api.py Ver fichero

@@ -23,7 +23,7 @@ def request(query, params):
23 23
     params['url'] = search_url.format(query=urlencode({'input': query}),
24 24
                                       api_key=api_key)
25 25
 
26
-     need this for url in response
26
+    # need this for url in response
27 27
     global my_query
28 28
     my_query = query
29 29