forked from zaclys/searxng
[enh] search count
This commit is contained in:
parent
7965da55a7
commit
13a4582a40
|
@ -32,6 +32,7 @@ searx_dir = join(engine_dir, '../../')
|
||||||
|
|
||||||
engines_config = ConfigParser.SafeConfigParser()
|
engines_config = ConfigParser.SafeConfigParser()
|
||||||
engines_config.read(join(searx_dir, 'engines.cfg'))
|
engines_config.read(join(searx_dir, 'engines.cfg'))
|
||||||
|
number_of_searches = 0
|
||||||
|
|
||||||
engines = {}
|
engines = {}
|
||||||
|
|
||||||
|
@ -90,10 +91,11 @@ def make_callback(engine_name, results, callback, params):
|
||||||
return process_callback
|
return process_callback
|
||||||
|
|
||||||
def search(query, request, selected_categories):
|
def search(query, request, selected_categories):
|
||||||
global engines, categories
|
global engines, categories, number_of_searches
|
||||||
requests = []
|
requests = []
|
||||||
results = {}
|
results = {}
|
||||||
selected_engines = []
|
selected_engines = []
|
||||||
|
number_of_searches += 1
|
||||||
user_agent = request.headers.get('User-Agent', '')
|
user_agent = request.headers.get('User-Agent', '')
|
||||||
if not len(selected_categories):
|
if not len(selected_categories):
|
||||||
selected_categories = ['general']
|
selected_categories = ['general']
|
||||||
|
|
Loading…
Reference in New Issue