summaryrefslogtreecommitdiff
path: root/searx/engines
diff options
context:
space:
mode:
authordalf <alex@al-f.net>2014-10-02 23:36:18 +0200
committerdalf <alex@al-f.net>2014-10-02 23:40:06 +0200
commit63a0328c8b26c5d749ecf83ee73a44902e1d5cef (patch)
tree50ada9411ed2e2ad13125a542f0f7b24360e2e62 /searx/engines
parent728fc611da126ddb20cb16ccaa214a1f6d8bcdbd (diff)
downloadsearxng-63a0328c8b26c5d749ecf83ee73a44902e1d5cef.tar.gz
searxng-63a0328c8b26c5d749ecf83ee73a44902e1d5cef.zip
[enh] wikidata engine : add links to musicbrainz
Diffstat (limited to 'searx/engines')
-rw-r--r--searx/engines/wikidata.py23
1 files changed, 22 insertions, 1 deletions
diff --git a/searx/engines/wikidata.py b/searx/engines/wikidata.py
index 46f2323c8..e8af8e204 100644
--- a/searx/engines/wikidata.py
+++ b/searx/engines/wikidata.py
@@ -69,13 +69,34 @@ def getDetail(jsonresponse, wikidata_id, language):
add_url(urls, 'Wikiquote (' + language + ')', get_wikilink(result, language + 'wikiquote'))
add_url(urls, 'Wikiquote (en)', get_wikilink(result, 'enwikiquote'))
-
add_url(urls, 'Commons wiki', get_wikilink(result, 'commonswiki'))
add_url(urls, 'Location', get_geolink(claims, 'P625', None))
add_url(urls, 'Wikidata', 'https://www.wikidata.org/wiki/' + wikidata_id + '?uselang='+ language)
+ musicbrainz_work_id = get_string(claims, 'P435')
+ if musicbrainz_work_id != None:
+ add_url(urls, 'MusicBrainz', 'http://musicbrainz.org/work/' + musicbrainz_work_id)
+
+ musicbrainz_artist_id = get_string(claims, 'P434')
+ if musicbrainz_artist_id != None:
+ add_url(urls, 'MusicBrainz', 'http://musicbrainz.org/artist/' + musicbrainz_artist_id)
+
+ musicbrainz_release_group_id = get_string(claims, 'P436')
+ if musicbrainz_release_group_id != None:
+ add_url(urls, 'MusicBrainz', 'http://musicbrainz.org/release-group/' + musicbrainz_release_group_id)
+
+ musicbrainz_label_id = get_string(claims, 'P966')
+ if musicbrainz_label_id != None:
+ add_url(urls, 'MusicBrainz', 'http://musicbrainz.org/label/' + musicbrainz_label_id)
+
+ # musicbrainz_area_id = get_string(claims, 'P982')
+ # P1407 MusicBrainz series ID
+ # P1004 MusicBrainz place ID
+ # P1330 MusicBrainz instrument ID
+ # P1407 MusicBrainz series ID
+
postal_code = get_string(claims, 'P281', None)
if postal_code != None:
attributes.append({'label' : 'Postal code(s)', 'value' : postal_code})