Created
April 20, 2011 10:23
-
-
Save yanyaoer/930933 to your computer and use it in GitHub Desktop.
listening my douban.fm with python & mpg123
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# vim: set et sw=4 ts=4 sts=4 fdm=syntax ff=unix fenc=utf8: | |
#!/usr/bin/python | |
import json | |
from subprocess import Popen | |
import urllib2 | |
_url = 'http://douban.fm/j/mine/playlist?type=n&h=&channel=0' | |
req = urllib2.urlopen(urllib2.Request(_url)) | |
obj = json.load(req) | |
playlist = '' | |
for s in obj['song']: | |
playlist = playlist+" "+s['url'] | |
Popen('mpg123 '+playlist, shell=True) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
it can NOT work currently.