look at the other last.fm script, i.e.
toptags = child.getElementsByTagName("tag")
tags=[]
for i in toptags:
tags.append(str(i.getElementsByTagName("name")[0].toxml()).replace('<name>','').replace('</name>','').capitalize( ))
lyric=str(tags).strip('[]').replace(',', ';').replace('\'','')
try something like that
Thanks for the suggestion I now get a syntax error in some of the code you posted. To make it a little easier, here's a larger snippet with your suggestion pasted in :
artist = handle.Format("[%artist%]")
title = handle.Format("3")
try:
string=urllib.urlopen('http://ws.audioscrobbler.com/2.0/?method=artist.getsimilar&artist=' + artist.lower().replace(' ','+') + '&limit=' + title.lower().replace(' ','+') + '&api_key=' + api_key).read()
doc = minidom.parseString(string)
toptags = child.getElementsByTagName("tag")
tags=[]
for i in toptags:
tags.append(str(i.getElementsByTagName("name")[0].toxml()).replace('<name>','').replace('</name>','').capitalize( ))
lyric=str(tags).strip('[]').replace(',', ';').replace('\'','')
result.append(lyric)
except Exception, e:
traceback.print_exc(file=sys.stdout)
result.append('')
continue
return result
if __name__ == "__main__":
LyricProviderInstance = LastFm_TopTag()