Some typo

This commit is contained in:
Aaron Mueller 2014-01-17 22:14:12 +01:00
parent 64a7037f8a
commit 5562d451ce
2 changed files with 5 additions and 6 deletions

View file

@ -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))

View file

@ -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}))