summaryrefslogtreecommitdiff
path: root/searx/engines
diff options
context:
space:
mode:
authorAdam Tauber <asciimoo@gmail.com>2020-06-09 23:49:13 +0200
committerAdam Tauber <asciimoo@gmail.com>2020-06-09 23:49:13 +0200
commit29960aa1d912f365846731c9aca166b5b7879d02 (patch)
tree1ba75fdbd67de4235760d1e559501332218c0425 /searx/engines
parent6c062862513dcaeebeb497ba1c61ea83e3a9e50b (diff)
downloadsearxng-29960aa1d912f365846731c9aca166b5b7879d02.tar.gz
searxng-29960aa1d912f365846731c9aca166b5b7879d02.zip
[enh] add official site link to the top of the infobox - closes #1644
Diffstat (limited to 'searx/engines')
-rw-r--r--searx/engines/wikidata.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/searx/engines/wikidata.py b/searx/engines/wikidata.py
index e913b3915..9d6238d8b 100644
--- a/searx/engines/wikidata.py
+++ b/searx/engines/wikidata.py
@@ -414,11 +414,13 @@ def add_url(urls, result, id_cache, property_id=None, default_label=None, url_pr
# append urls
for url in links:
if url is not None:
- urls.append({'title': default_label or label,
- 'url': url})
+ u = {'title': default_label or label, 'url': url}
+ if property_id == 'P856':
+ u['official'] = True
+ u['domain'] = url.split('/')[2]
+ urls.append(u)
if results is not None:
- results.append({'title': default_label or label,
- 'url': url})
+ results.append(u)
def get_imdblink(result, url_prefix):