Some typo
This commit is contained in:
parent
64a7037f8a
commit
5562d451ce
2 changed files with 5 additions and 6 deletions
|
@ -24,7 +24,6 @@
|
||||||
(images/sourceimage->fullscreen raw-image-path (images/image-name "fullscreen" id number))
|
(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/sourceimage->thumb raw-image-path (images/image-name "thumbs" id number))))
|
||||||
(:images new-entry))))
|
(:images new-entry))))
|
||||||
; TODO: save 'links' to 'sources' in DB
|
|
||||||
|
|
||||||
(defn fetch-all-content []
|
(defn fetch-all-content []
|
||||||
(let [pages (range 1)] ;(scrape/number-of-pages)]
|
(let [pages (range 1)] ;(scrape/number-of-pages)]
|
||||||
|
@ -36,7 +35,7 @@
|
||||||
(defn prepare []
|
(defn prepare []
|
||||||
(cleanup)
|
(cleanup)
|
||||||
(schema/create-tables)
|
(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 []
|
(defn start []
|
||||||
(fetch-all-content))
|
(fetch-all-content))
|
||||||
|
|
|
@ -47,13 +47,13 @@
|
||||||
(defn images-on-entry [content]
|
(defn images-on-entry [content]
|
||||||
(map #(:href (:attrs %1)) (html/select [content] [:table html/first-child :a])))
|
(map #(:href (:attrs %1)) (html/select [content] [:table html/first-child :a])))
|
||||||
|
|
||||||
(defn format-entry-type [unformated-type]
|
(defn format-entry-type [unformatted-type]
|
||||||
(if (= unformated-type "Jam Entry") "jam" "compo"))
|
(if (= unformatted-type "Jam Entry") "jam" "compo"))
|
||||||
|
|
||||||
(defn entry-details [entry-id]
|
(defn entry-details [entry-id]
|
||||||
(let [content (first (html/select (fetch-url (url-entry entry-id)) [:div#compo2]))
|
(let [content (first (html/select (fetch-url (url-entry entry-id)) [:div#compo2]))
|
||||||
title-parts (first (html/texts (html/select [content] [:h3])))
|
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)
|
links (links-on-entry content)
|
||||||
description (html/text (nth (html/select [content] [:p]) 2))
|
description (html/text (nth (html/select [content] [:p]) 2))
|
||||||
images (images-on-entry content)]
|
images (images-on-entry content)]
|
||||||
|
@ -61,7 +61,7 @@
|
||||||
:title title
|
:title title
|
||||||
:description description
|
:description description
|
||||||
:author author
|
:author author
|
||||||
:type (format-entry-type type)
|
:type (format-entry-type unformatted-type)
|
||||||
:links links
|
:links links
|
||||||
:images images}))
|
:images images}))
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue