#!/usr/bin/env python
import pylast
# You have to have your own unique two values for API_KEY and API_SECRET
# Obtain yours from http://www.last.fm/api/account for Last.fm
API_KEY = "TODO_ENTER_YOURS"
API_SECRET = "TODO_ENTER_YOURS"
lastfm_network = pylast.LastFMNetwork(api_key = API_KEY, api_secret = API_SECRET)
artist = lastfm_network.get_artist("Test Artist")
print "Listeners:", artist.get_listener_count()
print "Scrobbles:", artist.get_playcount()
以下是使用pylast的方法:
输出:
^{pr2}$相关问题 更多 >
编程相关推荐