-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbb.edn
32 lines (28 loc) · 1.4 KB
/
bb.edn
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
{:paths ["src/" "."]
:tasks
{:requires ([babashka.fs :as fs]
[babashka.process :as p :refer [process]]
[babashka.wait :as wait])
nrepl (let [port (with-open [sock (java.net.ServerSocket. 0)] (.getLocalPort sock))
proc (process (str "bb nrepl-server " port) {:inherit true})]
(wait/wait-for-port "localhost" port)
(spit ".nrepl-port" port)
(fs/delete-on-exit ".nrepl-port")
(deref proc))
:enter (println "Entering:" (:name (current-task)) " - " (:doc (current-task)) )
hrefs {:doc "Step 1: scrapes IMT website for hrefs only"
:task (shell "npx nbb src/hrefs.cljs")}
schools {:doc "Step 2: scrapes IMT website for the entire school data using the hrefs"
:task (shell "bb -m schools")}
cleanup {:doc "Step 3: Cleans the data in the predefined sort order"
:task (shell "bb -m cleanup")}
file-writer {:doc "Step 4: writes to final file structure and adds :archived-last-seen-at"
:task (shell "bb -m file-writer")}
run-all {:doc "Do the whole thing"
:task (do (run 'hrefs)
(run 'schools)
#_(if (seq (fs/modified-since "parsed-data/db.edn"
"schools.edn")))
(run 'cleanup)
(run 'file-writer)
#_(println "No new schools"))}}}