From 13a4582a40fd91b073dd54b4d93b7df882035ba9 Mon Sep 17 00:00:00 2001 From: asciimoo Date: Sun, 27 Oct 2013 13:55:18 +0100 Subject: [PATCH] [enh] search count --- searx/engines/__init__.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/searx/engines/__init__.py b/searx/engines/__init__.py index a9a23f080..366b83840 100644 --- a/searx/engines/__init__.py +++ b/searx/engines/__init__.py @@ -32,6 +32,7 @@ searx_dir = join(engine_dir, '../../') engines_config = ConfigParser.SafeConfigParser() engines_config.read(join(searx_dir, 'engines.cfg')) +number_of_searches = 0 engines = {} @@ -90,10 +91,11 @@ def make_callback(engine_name, results, callback, params): return process_callback def search(query, request, selected_categories): - global engines, categories + global engines, categories, number_of_searches requests = [] results = {} selected_engines = [] + number_of_searches += 1 user_agent = request.headers.get('User-Agent', '') if not len(selected_categories): selected_categories = ['general']