Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Some #cluglife hacking.
  • Loading branch information
kingcons committed Apr 27, 2012
1 parent 4366fff commit 08f6703
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 1 deletion.
23 changes: 23 additions & 0 deletions src/playlist.lisp
@@ -0,0 +1,23 @@
(in-package :cl-echonest)

;; Totally busted.
(defun playlist-basic (&key (type "song-radio") (results 15) artists song-ids)
(let ((result (echonest-call "playlist" "basic"
`(("type" . ,type)
("results" . ,(princ-to-string results))
;; TODO: List handling is totally F-in broken
,@(when artists
`(("artist" . ,artists)))
,@(when song-ids
`(("song_id" . ,song-ids)))))))
(getjso* "songs" result)))

;; Bobby Tank - Circles: TRAHHWP136F598034A
;; Bondax - Just Us: TRVURQT136F05FEEF8
;; Montgomery Clunk - Heat: TROEYCX136F056A215
;; Bobby Tank - Needin Me: 3999c0e7710e057cf64c4dcf63ed4eb4
;; OL - IWM: TRRBVKJ136F59E016A
;; Mono/Poly - Glow: SOENCZV1315CD513E9
;; Bibio - Fire Ant: SOQFJVS131677157D0
;; Star Slinger - Mornin: SOAZZOT1338A5D6187
;; Alex B - Standing on Me:
8 changes: 8 additions & 0 deletions src/song.lisp
@@ -0,0 +1,8 @@
(in-package :cl-echonest)

(defun song-search (artist &optional title)
(let ((result (echonest-call "song" "search"
`(("artist" . ,artist)
,@(when title
`(("title" . ,title)))))))
(getjso* "songs" result)))
2 changes: 1 addition & 1 deletion src/track.lisp
Expand Up @@ -15,7 +15,7 @@
;; KLUDGE: drakma::dissect-query and hunchentoot::url-decode are
;; needed just to pass the signature correctly :-/ WTF
(params (mapcar (lambda (pair)
(cons (car pair) (url-decode (cdr pair))))
(cons (car pair) (%url-decode (cdr pair))))
(drakma::dissect-query (subseq url (1+ params-idx))))))
(st-json:read-json (drakma:http-request (subseq url 0 params-idx)
:parameters params))))
Expand Down

0 comments on commit 08f6703

Please sign in to comment.