summaryrefslogtreecommitdiff
path: root/searx/webapp.py
diff options
context:
space:
mode:
authorAdam Tauber <asciimoo@gmail.com>2015-04-25 12:52:07 -0400
committerAdam Tauber <asciimoo@gmail.com>2015-04-25 12:52:07 -0400
commit952473d297b2f0131196086f5824ae48f32d2922 (patch)
treef00e457ccc2546b9aec782ac80e2164ea325c93a /searx/webapp.py
parent33516256fd60d5bf6dcdf38c8a31f4038ecf0524 (diff)
parent5c63f2a80a749897b66604e43cc483306d263aeb (diff)
downloadsearxng-952473d297b2f0131196086f5824ae48f32d2922.tar.gz
searxng-952473d297b2f0131196086f5824ae48f32d2922.zip
Merge pull request #246 from Cqoicebordel/pix-arts
New theme !
Diffstat (limited to 'searx/webapp.py')
-rw-r--r--searx/webapp.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/searx/webapp.py b/searx/webapp.py
index 52ced1363..0d06fbe0c 100644
--- a/searx/webapp.py
+++ b/searx/webapp.py
@@ -42,6 +42,7 @@ except:
from datetime import datetime, timedelta
from urllib import urlencode
+from urlparse import urlparse
from werkzeug.contrib.fixers import ProxyFix
from flask import (
Flask, request, render_template, url_for, Response, make_response,
@@ -181,6 +182,12 @@ def code_highlighter(codelines, language=None):
return html_code
+# Extract domain from url
+@app.template_filter('extract_domain')
+def extract_domain(url):
+ return urlparse(url)[1]
+
+
def get_base_url():
if settings['server']['base_url']:
hostname = settings['server']['base_url']