mirror of https://github.com/searx/searx
[fix] style of stackexchange engine
This commit is contained in:
parent
a1f9919587
commit
1d5feed4c1
|
@ -23,26 +23,28 @@ paging = True
|
|||
pagesize = 10
|
||||
|
||||
api_site = 'stackoverflow'
|
||||
api_sort= 'activity'
|
||||
api_sort = 'activity'
|
||||
api_order = 'desc'
|
||||
|
||||
# https://api.stackexchange.com/docs/advanced-search
|
||||
search_api = 'https://api.stackexchange.com/2.3/search/advanced?'
|
||||
|
||||
|
||||
def request(query, params):
|
||||
|
||||
args = urlencode({
|
||||
'q' : query,
|
||||
'page' : params['pageno'],
|
||||
'pagesize' : pagesize,
|
||||
'site' : api_site,
|
||||
'sort' : api_sort,
|
||||
'order': 'desc',
|
||||
})
|
||||
'q': query,
|
||||
'page': params['pageno'],
|
||||
'pagesize': pagesize,
|
||||
'site': api_site,
|
||||
'sort': api_sort,
|
||||
'order': api_order,
|
||||
})
|
||||
params['url'] = search_api + args
|
||||
|
||||
return params
|
||||
|
||||
|
||||
def response(resp):
|
||||
|
||||
results = []
|
||||
|
@ -58,7 +60,7 @@ def response(resp):
|
|||
|
||||
results.append({
|
||||
'url': "https://%s.com/q/%s" % (api_site, result['question_id']),
|
||||
'title': html.unescape(result['title']),
|
||||
'title': html.unescape(result['title']),
|
||||
'content': html.unescape(content),
|
||||
})
|
||||
|
||||
|
|
Loading…
Reference in New Issue