summaryrefslogtreecommitdiff
path: root/searx/utils.py
diff options
context:
space:
mode:
authorDalf <alex@al-f.net>2015-06-04 18:30:08 +0200
committerDalf <alex@al-f.net>2015-06-04 18:30:08 +0200
commit62cc2a5658c9f2cfe75c0af0e5db125d2c6f8e38 (patch)
tree8f39ae01c7a97723e75f90bccfd6db2a783d7d5d /searx/utils.py
parentcdf931f949f8eaa13522c07577177af1e8863a41 (diff)
downloadsearxng-62cc2a5658c9f2cfe75c0af0e5db125d2c6f8e38.tar.gz
searxng-62cc2a5658c9f2cfe75c0af0e5db125d2c6f8e38.zip
[fix] bing_news based on RSS output format
Diffstat (limited to 'searx/utils.py')
-rw-r--r--searx/utils.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/searx/utils.py b/searx/utils.py
index 129971e31..c9784159c 100644
--- a/searx/utils.py
+++ b/searx/utils.py
@@ -228,6 +228,14 @@ def prettify_url(url):
return url
+# get element in list or default value
+def list_get(a_list, index, default=None):
+ if len(a_list) > index:
+ return a_list[index]
+ else:
+ return default
+
+
def get_blocked_engines(engines, cookies):
if 'blocked_engines' not in cookies:
return [(engine_name, category) for engine_name in engines