Skip to content

Instantly share code, notes, and snippets.

@plamere
Created January 16, 2014 12:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save plamere/8454269 to your computer and use it in GitHub Desktop.
Save plamere/8454269 to your computer and use it in GitHub Desktop.
Shows the top artists for a genre
import pyen
import sys
en = pyen.Pyen()
if len(sys.argv) > 1:
genre = ' '.join(sys.argv[1:])
response = en.get('genre/artists', name=genre)
for artist in response['artists']:
print artist['name']
else:
print "usage: python top_artists_for_genre.py genre name"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment