Another reason I like Clojure

Exploring new packages of code, say the latest jar from Echo Nest, is incredibly easy and just plain fun. For instance:

(import '(com.echonest.api.v3.artist Artist ArtistAPI DocumentList))
(def artist-api (new ArtistAPI "YOUR DEV KEY HERE"))
(def hot-artists (. artist-api getTopHotttArtists 10))
(println (.. (first hot-artists) getItem getName))

Will spit out “Papercuts” (as of the time of this writing), the current #1 artist on Echo Nest’s Hottt list.

I started looking for a nice plugin for Wordpress that would’ve done some pretty syntax highlighting on the Clojure code but it was taking too long. Spent less time writing up the Clojure actually.

This entry was posted in clojure and tagged , . Bookmark the permalink. Both comments and trackbacks are currently closed.