mirror of
https://github.com/searxng/searxng.git
synced 2024-12-23 09:46:31 +00:00
Merge pull request #615 from return42/pylint-reddit
[pylint] Reddit engine
This commit is contained in:
commit
b5d4cac7e1
1 changed files with 4 additions and 4 deletions
|
@ -1,6 +1,6 @@
|
||||||
# SPDX-License-Identifier: AGPL-3.0-or-later
|
# SPDX-License-Identifier: AGPL-3.0-or-later
|
||||||
"""
|
# lint: pylint
|
||||||
Reddit
|
"""Reddit
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import json
|
import json
|
||||||
|
@ -26,16 +26,16 @@ base_url = 'https://www.reddit.com/'
|
||||||
search_url = base_url + 'search.json?{query}'
|
search_url = base_url + 'search.json?{query}'
|
||||||
|
|
||||||
|
|
||||||
# do search-request
|
|
||||||
def request(query, params):
|
def request(query, params):
|
||||||
|
|
||||||
query = urlencode({'q': query, 'limit': page_size})
|
query = urlencode({'q': query, 'limit': page_size})
|
||||||
params['url'] = search_url.format(query=query)
|
params['url'] = search_url.format(query=query)
|
||||||
|
|
||||||
return params
|
return params
|
||||||
|
|
||||||
|
|
||||||
# get response from search-request
|
|
||||||
def response(resp):
|
def response(resp):
|
||||||
|
|
||||||
img_results = []
|
img_results = []
|
||||||
text_results = []
|
text_results = []
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue