src/newseasons/itunes.clj @ d6f1f9d14b82
Factor out itunes and fix search styles.
author |
Steve Losh <steve@stevelosh.com> |
date |
Mon, 03 Oct 2011 20:18:16 -0400 |
parents |
(none) |
children |
89f24149ecd7 |
(ns newseasons.itunes
(:require [clj-http.client :as client])
(:use [cheshire.core :only (parse-string)]))
(defn itunes-search [params]
((parse-string (:body (client/get "http://itunes.apple.com/search"
{:query-params params})))
"results"))
(defn itunes-search-show [query]
(itunes-search {"term" query
"media" "tvShow"
"entity" "tvSeason"
"attribute" "showTerm"}))
(defn itunes-lookup [field id]
((parse-string (:body (client/get "http://itunes.apple.com/search"
{:query-params {field id}})))
"results"))
(defn itunes-lookup-artist [id]
(first (itunes-lookup "id" id)))