Skip to content

Instantly share code, notes, and snippets.

@mcroydon
Created March 19, 2009 14:31
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 mcroydon/81837 to your computer and use it in GitHub Desktop.
Save mcroydon/81837 to your computer and use it in GitHub Desktop.
# yes_note.py for PyS60 - Matt Croydon - License: GPL
# Requires json.py from http://www.mobilepythonbook.org/
import urllib, json, appuifw
BASE_URL = 'http://api.yes.com/1/'
station = appuifw.query(u'Enter a station', 'text')
station = station.upper()
NOW_URL = BASE_URL + 'station?name=%s' % station
data = json.read(urllib.urlopen(NOW_URL).read())
appuifw.note(u"Currently playing: %s by %s" % (data['now']['song'], data['now']['artist']), 'info')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment