searxng/examples/basic_engine.py

24 lines
437 B
Python
Raw Normal View History

2013-10-14 22:19:25 +00:00
2013-10-19 18:54:21 +00:00
categories = ['general'] # optional
2013-10-14 22:19:25 +00:00
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
'''
2013-10-15 17:11:43 +00:00
return [{'url': '', 'title': '', 'content': ''}]
2013-10-14 22:19:25 +00:00