I am trying to write a python script to fulfill a request to Last.fm, but I keep getting the wrong method error.
I don't need links to pre-written python libraries last.fm, I'm trying to do this as a "verify what I know" project. Thanks in advance!
import urllib
import httplib
params = urllib.urlencode({'method' : 'artist.getsimilar',
'artist' : 'band',
'limit' : '5',
'api_key' :
header = {"user-agent" : "myapp/1.0"}
lastfm = httplib.HTTPConnection("ws.audioscrobbler.com")
lastfm.request("POST","/2.0/?",params,header)
response = lastfm.getresponse()
print response.read()
source
share