Created
November 6, 2014 17:26
-
-
Save littlehaker/312dd16fbbb23f596147 to your computer and use it in GitHub Desktop.
Emacs 豆瓣电台
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
(require 'ht) | |
(require 'web) | |
(require 'dash) | |
(defun my-emacs-douban-play () | |
(interactive) | |
(web-http-get | |
(lambda (con header data) | |
;; local variables | |
(let* ((json (ht<-alist (json-read-from-string data))) | |
(songs (ht-get json 'song))) | |
(progn | |
(-map (lambda (song) | |
;; add url to emms | |
(emms-add-url (ht-get (ht<-alist song) 'url))) | |
songs) | |
;; start emms | |
(emms-start)))) | |
:url "http://douban.fm/j/mine/playlist?type=n&channel=0")) | |
(provide 'my-emacs-douban) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment