mirror of
https://github.com/searxng/searxng.git
synced 2024-11-25 20:31:00 +00:00
[enh] examples added
This commit is contained in:
parent
62f6d34b95
commit
26c9c0e8be
1 changed files with 21 additions and 0 deletions
21
examples/basic_engine.py
Normal file
21
examples/basic_engine.py
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
|
||||||
|
def request(query, params):
|
||||||
|
'''pre-request callback
|
||||||
|
params<dict>:
|
||||||
|
method : POST/GET
|
||||||
|
headers : {}
|
||||||
|
data : {} # if method == POST
|
||||||
|
url : ''
|
||||||
|
'''
|
||||||
|
|
||||||
|
params['url'] = 'https://host/%s' % query
|
||||||
|
|
||||||
|
return params
|
||||||
|
|
||||||
|
|
||||||
|
def response(resp):
|
||||||
|
'''post-response callback
|
||||||
|
resp: requests response object
|
||||||
|
'''
|
||||||
|
return [resp.text]
|
||||||
|
|
Loading…
Reference in a new issue