SearXNG is a free internet metasearch engine which aggregates results from various search services and databases. Users are neither tracked nor profiled.
Python bingbravedegoogleduckduckgogooglemetasearchprivacypythonqwantsearchsearch-enginesearxsearxngstartpageyahoo
[enh] preferences added
asciimoo1df697305c4f
diff --git a/searx/webapp.py b/searx/webapp.pyindex c95cae2c2..e06b985d1 100644--- a/searx/webapp.py+++ b/searx/webapp.py@@ -124,29 +124,47 @@ def index():response.headers.add('Content-Disposition', 'attachment;Filename=searx_-_{0}.csv'.format('_'.join(query.split())))return response- template = render('results.html'- ,results=results- ,q=request_data['q']- ,selected_categories=selected_categories- ,number_of_results=len(results)- ,suggestions=suggestions- )- resp = make_response(template)- resp.set_cookie('categories', ','.join(selected_categories))+ return render('results.html'+ ,results=results+ ,q=request_data['q']+ ,selected_categories=selected_categories+ ,number_of_results=len(results)+ ,suggestions=suggestions+ )- return resp@app.route('/about', methods=['GET'])def about():global categoriesreturn render('about.html', categs=categories.items())+[email protected]('/preferences', methods=['GET', 'POST'])+def preferences():++ if request.method=='POST':+ selected_categories = []+ for pd_name,pd in request.form.items():+ if pd_name.startswith('category_'):+ category = pd_name[9:]+ if not category in categories:+ continue+ selected_categories.append(category)+ if selected_categories:+ template = render('preferences.html', selected_categories=selected_categories)+ resp = make_response(template)+ resp.set_cookie('categories', ','.join(selected_categories))+ return resp+ return render('preferences.html')++@app.route('/stats', methods=['GET'])def stats():global categoriesstats = get_engines_stats()return render('stats.html', stats=stats)+@app.route('/robots.txt', methods=['GET'])def robots():return Response("""User-agent: *@@ -155,6 +173,7 @@ Allow: /aboutDisallow: /stats""", mimetype='text/plain')+@app.route('/opensearch.xml', methods=['GET'])def opensearch():global opensearch_xml