Skip to content

Instantly share code, notes, and snippets.

@corecode
Created January 11, 2013 13:24
Show Gist options
  • Save corecode/4510626 to your computer and use it in GitHub Desktop.
Save corecode/4510626 to your computer and use it in GitHub Desktop.
(require 'url)
(require 'json)
(url-retrieve "http://api.soundcloud.com/users/corecode/favorites.json?client_id=YOUR_CLIENT_ID"
(lambda (status)
(message "status: %s" (json-encode status))
(search-forward "\n\n")
(let* ((json (buffer-substring (point) (point-max)))
(json-object-type 'plist)
(json-array-type 'list)
(data (json-read)))
(dolist (fav data)
(message "track %s by %s url `%s'"
(plist-get fav :title)
(plist-get (plist-get fav :user) :username)
(plist-get fav :stream_url))))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment