Skip to content

Instantly share code, notes, and snippets.

@newgiin
Created March 25, 2014 01:25
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 newgiin/9753619 to your computer and use it in GitHub Desktop.
Save newgiin/9753619 to your computer and use it in GitHub Desktop.
Test artist.gettoptags last.fm service
import time
import json
import urllib2
while True:
url = 'http://ws.audioscrobbler.com/2.0/?method=artist.gettoptags&artist=Example&api_key=24836bd9d7043e3c0bc65aa801ba8821&format=json'
res = json.load(urllib2.urlopen(url))
if 'toptags' not in res:
print res # should never get here!
time.sleep(.2)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment