[Assorted-commits] SF.net SVN: assorted:[1389] sandbox/trunk/src/py/lastfm.py
Brought to you by:
yangzhang
From: <yan...@us...> - 2009-05-07 06:57:37
|
Revision: 1389 http://assorted.svn.sourceforge.net/assorted/?rev=1389&view=rev Author: yangzhang Date: 2009-05-07 06:57:35 +0000 (Thu, 07 May 2009) Log Message: ----------- oops, committed api key Modified Paths: -------------- sandbox/trunk/src/py/lastfm.py Modified: sandbox/trunk/src/py/lastfm.py =================================================================== --- sandbox/trunk/src/py/lastfm.py 2009-05-07 06:25:44 UTC (rev 1388) +++ sandbox/trunk/src/py/lastfm.py 2009-05-07 06:57:35 UTC (rev 1389) @@ -2,8 +2,9 @@ # Demo of using pylast, the last.fm Python API. -import pylast -api = '3222517b613ce7a7091f1aff29edd67a' +from __future__ import with_statement +import pylast, os +with file(os.path.expanduser('~/.lastfmkey')) as f: api = f.read().strip() a = pylast.Artist('daughtry', api) def cb(*args): print args a.async_call(call = a.getTopTags, callback = cb) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |