on master help sign in
[fix] unescape htmlentities in wolframalpha_noapi's answer
commit576d37f256649b570a9c8591a795acd85ac499bc authora01200356 <a01200356@itesm.mx> dateSun 3 Jan 2016, 15:58 (11 years ago) parent16d6e75
2 files changed+8−2
searx/engines/wolframalpha_noapi.py+6−1 searx/settings.yml+2−1
searx/engines/wolframalpha_noapi.py+6−1
@@ -12,6 +12,7 @@ from re import search, sub
1212from json import loads
1313from urllib import urlencode
1414from lxml import html
15+import HTMLParser
1516
1617# search-url
1718url = 'http://www.wolframalpha.com/'
@@ -62,7 +63,11 @@ def response(resp):
6263 # extract answer from json
6364 answer = line[line.find('{'):line.rfind('}')+1]
6465 answer = loads(answer.encode('unicode-escape'))
65− answer = answer['stringified'].decode('unicode-escape')
66+ answer = answer['stringified']
67+
68+ # clean plaintext answer
69+ h = HTMLParser.HTMLParser()
70+ answer = h.unescape(answer.decode('unicode-escape'))
6671 answer = sub(r'\\', '', answer)
6772
6873 results.append({'answer': answer})
searx/settings.yml+2−1
@@ -305,9 +305,10 @@ engines:
305305 # You can use the engine using the official stable API, but you need an API key
306306 # See : http://products.wolframalpha.com/api/
307307 # engine : wolframalpha_api
308− # api_key: '5952JX-X52L3VKWT8' # required!
308+ # api_key: '' # required!
309309 engine : wolframalpha_noapi
310310 timeout: 6.0
311+ disabled : True
311312
312313#The blekko technology and team have joined IBM Watson! -> https://blekko.com/
313314# - name : blekko images