diff options
author | a01200356 <a01200356@itesm.mx> | 2016-03-14 00:32:36 -0600 |
---|---|---|
committer | a01200356 <a01200356@itesm.mx> | 2016-04-17 16:22:19 -0500 |
commit | 8d335dbdaedd6113242e785e8fabac86128d069a (patch) | |
tree | ecd75df0c02b19b7a6de5290d061fc4bf731e521 /searx/engines/wikidata.py | |
parent | 817c74e52317126128c6f8740df01b8bdc51c3cf (diff) | |
download | searxng-8d335dbdaedd6113242e785e8fabac86128d069a.tar.gz searxng-8d335dbdaedd6113242e785e8fabac86128d069a.zip |
[enh] wikipedia infobox
creates simple multilingual infobox using wikipedia's api
Diffstat (limited to 'searx/engines/wikidata.py')
-rw-r--r-- | searx/engines/wikidata.py | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/searx/engines/wikidata.py b/searx/engines/wikidata.py index 9f3496b72..8aa2fcd5c 100644 --- a/searx/engines/wikidata.py +++ b/searx/engines/wikidata.py @@ -86,15 +86,15 @@ def getDetail(jsonresponse, wikidata_id, language, locale): results.append({'title': title, 'url': official_website}) wikipedia_link_count = 0 + wikipedia_link = get_wikilink(result, language + 'wiki') + wikipedia_link_count += add_url(urls, + 'Wikipedia (' + language + ')', + wikipedia_link) if language != 'en': + wikipedia_en_link = get_wikilink(result, 'enwiki') wikipedia_link_count += add_url(urls, - 'Wikipedia (' + language + ')', - get_wikilink(result, language + - 'wiki')) - wikipedia_en_link = get_wikilink(result, 'enwiki') - wikipedia_link_count += add_url(urls, - 'Wikipedia (en)', - wikipedia_en_link) + 'Wikipedia (en)', + wikipedia_en_link) if wikipedia_link_count == 0: misc_language = get_wiki_firstlanguage(result, 'wiki') if misc_language is not None: @@ -188,7 +188,7 @@ def getDetail(jsonresponse, wikidata_id, language, locale): else: results.append({ 'infobox': title, - 'id': wikipedia_en_link, + 'id': wikipedia_link, 'content': description, 'attributes': attributes, 'urls': urls |