Mercurial > hg > camir-aes2014
annotate core/magnatagatune/fm_retrieve_artist_tags.m @ 0:e9a9cd732c1e tip
first hg version after svn
author | wolffd |
---|---|
date | Tue, 10 Feb 2015 15:05:51 +0000 |
parents | |
children |
rev | line source |
---|---|
wolffd@0 | 1 function [tags, tag_weight] = fm_retrieve_artist_tags(artist_name,bymbid) |
wolffd@0 | 2 %[tags, tag_weight] = fm_get_artist_tags(artist_name,bymbid) |
wolffd@0 | 3 % |
wolffd@0 | 4 % artist_name: either artist name string, or |
wolffd@0 | 5 % musicbrainz artist id with bymbid == 1 |
wolffd@0 | 6 % |
wolffd@0 | 7 % returns last.fm artist tags and tag weights for given artist |
wolffd@0 | 8 % this uses a lastpy python script to handle the REST data exchange |
wolffd@0 | 9 |
wolffd@0 | 10 if nargin < 2 |
wolffd@0 | 11 bymbid = '0'; |
wolffd@0 | 12 else |
wolffd@0 | 13 bymbid = num2str(bymbid); |
wolffd@0 | 14 end |
wolffd@0 | 15 |
wolffd@0 | 16 % call python function |
wolffd@0 | 17 tagstr = python('fm_retrieve_artist_tags.py',artist_name,bymbid); |
wolffd@0 | 18 |
wolffd@0 | 19 % parse text function output |
wolffd@0 | 20 tags = textscan(tagstr,'%s %d','Delimiter',','); |
wolffd@0 | 21 tag_weight = tags{2}; |
wolffd@0 | 22 tags = tags{1}; |