Skip to content

Instantly share code, notes, and snippets.

@andkon
Last active August 29, 2015 14:25
Show Gist options
  • Save andkon/5d9b019a3eb8918c99ac to your computer and use it in GitHub Desktop.
Save andkon/5d9b019a3eb8918c99ac to your computer and use it in GitHub Desktop.
davesingskaraoke
import pyen
en = pyen.Pyen(YOUR_API_KEY)
songs = []
for row in db:
try:
res = en.get('song/search', title=row.title, artist=row.artist, bucket=["song_type"])
if len(res.get('songs')) > 0:
songs.append(res.get('songs')[0])
except pyen.PyenException:
# fuck dat shit
pass
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment