 
 (defn list-shows [shows]
   [:table
-    (for [{genres  :genres
-           title   :title
-           theatre :theatre
-           image   :image}
-           shows]
-         [:tr
-           [:td [:img {:src image}]]
-           [:td title]
-           [:td theatre]
-           [:td genres]])])
+    (for [day shows]
+      [:tr
+        [:td (:time (first (:comedy day)))]
+        [:td (map :title (:comedy day))]])])
 
 (defn shows [shows]
   (layout (list-shows shows)))

                 genres
                 image])

(def finnish-date-format (formatter "dd.MM.yyyy"))

(def url (str "http://finnkino.fi/xml/Schedule/?area=1002&dt="
              (unparse finnish-date-format (now))))

(def movies (zip/xml-zip (xml/parse url)))

(defn get-shows [xz] 
  (for [show (xml-> xz :Shows :Show)]
    (Show.
      (xml1-> show :OriginalTitle text)

      (into #{} (split (xml1-> show :Genres text) #", "))
      (xml1-> show :Images :EventLargeImagePortrait text))))

(def finnish-date-format (formatter "dd.MM.yyyy"))

(def week-of-shows
  (pmap
    parse-shows
    (map
      #(zip/xml-zip (xml/parse (str "http://finnkino.fi/xml/Schedule/?area=1002&dt=" (unparse finnish-date-format %))))
      (for [day (range 7)]
        (.plusDays (now) day)))))

(def week-of-shows-grouped-by-genre
  (map group-by-genre (filter not-empty week-of-shows)))

(defroutes handler
  (GET "/" []
    (views/shows week-of-shows-grouped-by-genre)))

(run-jetty handler {:port 8080 :join? false})

