From 5562d451ce24af70bf3efb7b7168f65d8456e06b Mon Sep 17 00:00:00 2001 From: Aaron Mueller Date: Fri, 17 Jan 2014 22:14:12 +0100 Subject: [PATCH] Some typo --- src/ldview/tasks/runner.clj | 3 +-- src/ldview/tasks/scrape.clj | 8 ++++---- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/ldview/tasks/runner.clj b/src/ldview/tasks/runner.clj index bb880df..555057d 100644 --- a/src/ldview/tasks/runner.clj +++ b/src/ldview/tasks/runner.clj @@ -24,7 +24,6 @@ (images/sourceimage->fullscreen raw-image-path (images/image-name "fullscreen" id number)) (images/sourceimage->thumb raw-image-path (images/image-name "thumbs" id number)))) (:images new-entry)))) -; TODO: save 'links' to 'sources' in DB (defn fetch-all-content [] (let [pages (range 1)] ;(scrape/number-of-pages)] @@ -36,7 +35,7 @@ (defn prepare [] (cleanup) (schema/create-tables) - (competition/create! 27 "10 Seconds")) ; FIXME: Make it dynamic (ldview.tasks.scrape#competition) + (competition/create! 27 "10 Seconds")) ; FIXME: Make it dynamic (defn start [] (fetch-all-content)) diff --git a/src/ldview/tasks/scrape.clj b/src/ldview/tasks/scrape.clj index e2911b7..a13fe6a 100644 --- a/src/ldview/tasks/scrape.clj +++ b/src/ldview/tasks/scrape.clj @@ -47,13 +47,13 @@ (defn images-on-entry [content] (map #(:href (:attrs %1)) (html/select [content] [:table html/first-child :a]))) -(defn format-entry-type [unformated-type] - (if (= unformated-type "Jam Entry") "jam" "compo")) +(defn format-entry-type [unformatted-type] + (if (= unformatted-type "Jam Entry") "jam" "compo")) (defn entry-details [entry-id] (let [content (first (html/select (fetch-url (url-entry entry-id)) [:div#compo2])) title-parts (first (html/texts (html/select [content] [:h3]))) - [title author type] (split title-parts #" - ") + [title author unformatted-type] (split title-parts #" - ") links (links-on-entry content) description (html/text (nth (html/select [content] [:p]) 2)) images (images-on-entry content)] @@ -61,7 +61,7 @@ :title title :description description :author author - :type (format-entry-type type) + :type (format-entry-type unformatted-type) :links links :images images}))