wclastfm
last.fm api python script
In [3]:
import pylast
In [4]:
opke = open('/home/wcmckee/lfm.txt', 'r')
rekde = opke.read()
In [5]:
opke.close()
In [6]:
opsec = open('/home/wcmckee/lfm-sec.txt', 'r')
resec = opsec.read()
In [7]:
opsec.close()
In [8]:
oppas = open('/home/wcmckee/lfm-p.txt', 'r')
opred = oppas.read()
In [10]:
oppas.close()
In [14]:
phash = pylast.md5(str(opred))
In [ ]:
In [ ]:
pylast.
In [12]:
usr = 'galf666'
pa = str(opred)
In [16]:
netwo = pylast.LastFMNetwork(str(rekde), api_secret= str(resec), username = usr, password_hash= phash)
In [ ]:
In [ ]:
In [ ]:
In [ ]:
'''
Created on 6/12/2012
@author: Will
import pylast
import pprint
API_KEY = 'KEY'
API_SECRET = 'SEC'
username = "USERNAME"
password_hash = pylast.md5("YOUWILLNEVERGETTHIS")
network = pylast.LastFMNetwork(API_KEY, api_secret =
API_SECRET, username=username, password_hash=password_hash)
arti = raw_input("Enter the artist name: ")
artist = network.get_artist(arti)
cart = artist.get_bio_content()
pprint.pprint(cart)
test = artist.get_similar(20)
pprint.pprint(test)
doc = open('hellothere', 'w')
doc.write('---~~~--- ')
doc.write(arti)
doc.write('---~~~--- ')
doc.write('\n')
doc.write(cart)
doc.write('\n')
doc.write(arti)
doc.write('---~~~--- ')
doc.write('\n')
doc.close
'''