Skip to content

Instantly share code, notes, and snippets.

@hikoz
Created April 11, 2013 06:18
Show Gist options
  • Save hikoz/5361146 to your computer and use it in GitHub Desktop.
Save hikoz/5361146 to your computer and use it in GitHub Desktop.
#!/usr/bin/env lein exec
(use '[leiningen.exec :only (deps)])
(deps '[[clj-http "0.7.1"]])
(require '[clj-http.client :as client])
(defn api-request [url]
(:body (client/get url {:as :json})))
(let [user (api-request "http://ugomemo.hatena.ne.jp/11F9E990AA34FFBC@DSi.json")
movies (api-request "http://ugomemo.hatena.ne.jp/11F9E990AA34FFBC@DSi/movies.json")]
(printf "%sさんは%d個の作品を投稿しています。\n" (:name user) (:count movies)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment