mirror of
https://github.com/searxng/searxng.git
synced 2025-12-23 04:00:02 +00:00
[format.python] initial formatting of the python code
This patch was generated by black [1]::
make format.python
[1] https://github.com/psf/black
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
This commit is contained in:
@@ -13,19 +13,21 @@ def request(query, params):
|
||||
params['url'] = search_url
|
||||
params['method'] = 'POST'
|
||||
params['headers']['content-type'] = 'application/json'
|
||||
params['data'] = dumps({
|
||||
"queryString": query,
|
||||
"page": params['pageno'],
|
||||
"pageSize": 10,
|
||||
"sort": "relevance",
|
||||
"useFallbackRankerService": False,
|
||||
"useFallbackSearchCluster": False,
|
||||
"getQuerySuggestions": False,
|
||||
"authors": [],
|
||||
"coAuthors": [],
|
||||
"venues": [],
|
||||
"performTitleMatch": True,
|
||||
})
|
||||
params['data'] = dumps(
|
||||
{
|
||||
"queryString": query,
|
||||
"page": params['pageno'],
|
||||
"pageSize": 10,
|
||||
"sort": "relevance",
|
||||
"useFallbackRankerService": False,
|
||||
"useFallbackSearchCluster": False,
|
||||
"getQuerySuggestions": False,
|
||||
"authors": [],
|
||||
"coAuthors": [],
|
||||
"venues": [],
|
||||
"performTitleMatch": True,
|
||||
}
|
||||
)
|
||||
return params
|
||||
|
||||
|
||||
@@ -33,10 +35,12 @@ def response(resp):
|
||||
res = loads(resp.text)
|
||||
results = []
|
||||
for result in res['results']:
|
||||
results.append({
|
||||
'url': result['primaryPaperLink']['url'],
|
||||
'title': result['title']['text'],
|
||||
'content': result['paperAbstractTruncated']
|
||||
})
|
||||
results.append(
|
||||
{
|
||||
'url': result['primaryPaperLink']['url'],
|
||||
'title': result['title']['text'],
|
||||
'content': result['paperAbstractTruncated'],
|
||||
}
|
||||
)
|
||||
|
||||
return results
|
||||
|
||||
Reference in New Issue
Block a user