logo

searx

My custom branche(s) on searx, a meta-search engine git clone https://hacktivis.me/git/searx.git
commit: 63a0328c8b26c5d749ecf83ee73a44902e1d5cef
parent 728fc611da126ddb20cb16ccaa214a1f6d8bcdbd
Author: dalf <alex@al-f.net>
Date:   Thu,  2 Oct 2014 23:36:18 +0200

[enh] wikidata engine : add links to musicbrainz

Diffstat:

Msearx/engines/wikidata.py23++++++++++++++++++++++-
1 file changed, 22 insertions(+), 1 deletion(-)

diff --git 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})