logo

searx

My custom branche(s) on searx, a meta-search engine git clone https://hacktivis.me/git/searx.git

basic_engine.py (521B)


  1. categories = ['general'] # optional
  2. def request(query, params):
  3. '''pre-request callback
  4. params<dict>:
  5. method : POST/GET
  6. headers : {}
  7. data : {} # if method == POST
  8. url : ''
  9. category: 'search category'
  10. pageno : 1 # number of the requested page
  11. '''
  12. params['url'] = 'https://host/%s' % query
  13. return params
  14. def response(resp):
  15. '''post-response callback
  16. resp: requests response object
  17. '''
  18. return [{'url': '', 'title': '', 'content': ''}]