Created
April 5, 2014 17:22
-
-
Save coldclimate/9994931 to your computer and use it in GitHub Desktop.
Grab your last.fm all time stats and see what you've contributed to the world listening stats.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import lastfm | |
| api_key = 'REPLACEME' | |
| api = lastfm.Api(api_key) | |
| user = api.get_user('REPLACEME') | |
| tracks = user.top_tracks | |
| for track in tracks: | |
| gcount = api.get_track(artist=track.artist.name,track=track.name).stats.playcount | |
| print "%s %s %s of %s (%f )" % (track.artist.name,track.name, track.stats.playcount, gcount, track.stats.playcount/gcount) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment