Compare commits
No commits in common. "cd540fda369c8007f046819de0699f05eff477a1" and "693c47d46569eb1d56b3d54b018bad0aef112ee9" have entirely different histories.
cd540fda36
...
693c47d465
3 changed files with 6 additions and 30 deletions
|
@ -4,7 +4,7 @@
|
||||||
:default-board "/mlp/" ;Board to be used when no board=x param given
|
:default-board "/mlp/" ;Board to be used when no board=x param given
|
||||||
:board-disabled-message "This board is not enabled for feed generation.\n\nYou can contact me here: [contact]"
|
:board-disabled-message "This board is not enabled for feed generation.\n\nYou can contact me here: [contact]"
|
||||||
:enable-board-listing true ;Whether to show list of enabled boards in /boards
|
:enable-board-listing true ;Whether to show list of enabled boards in /boards
|
||||||
:boards-defaults {:refresh-rate 300 ;how often new data should be downloaded in seconds
|
:boards-defaults {:refresh-rate 300
|
||||||
:starting-page 7
|
:starting-page 7
|
||||||
:default-chod 94
|
:default-chod 94
|
||||||
;; If you want to do some preprocessing beforehand, you can override
|
;; If you want to do some preprocessing beforehand, you can override
|
||||||
|
@ -14,8 +14,7 @@
|
||||||
;; Commented parts bellow are still unimplemented
|
;; Commented parts bellow are still unimplemented
|
||||||
;; Only download catalog when someone requests feed and cache is old
|
;; Only download catalog when someone requests feed and cache is old
|
||||||
;; Saves request to 4chan, usefull for borads that are checked rarely
|
;; Saves request to 4chan, usefull for borads that are checked rarely
|
||||||
;; Generally the better option, first request in :refresh-rate may take longer
|
;; :lazy-load false
|
||||||
:lazy-load true
|
|
||||||
;; Whether to allow regex search thru the threads (&qr= param)
|
;; Whether to allow regex search thru the threads (&qr= param)
|
||||||
;; :regex-enable true
|
;; :regex-enable true
|
||||||
;; Wheter to create cache by downloading whole catalog or every required
|
;; Wheter to create cache by downloading whole catalog or every required
|
||||||
|
|
|
@ -56,21 +56,6 @@
|
||||||
(with-open [r (io/reader fl)]
|
(with-open [r (io/reader fl)]
|
||||||
(edn/read (java.io.PushbackReader. r))))))
|
(edn/read (java.io.PushbackReader. r))))))
|
||||||
|
|
||||||
(defn config-fill-board-defaults
|
|
||||||
"Fills every enabled board with default values"
|
|
||||||
[conifg]
|
|
||||||
;; Získat všechny klíče desek které musíme vyplnit
|
|
||||||
;; Každý klíč mergnout s default mapou
|
|
||||||
(u/map-apply-defaults )
|
|
||||||
(let [board-defaults (:boards-default config)
|
|
||||||
boards (keys (:boards-enabled config))]
|
|
||||||
(update-in config '(:boards-enabled) (fn [val]
|
|
||||||
(u/fmap (fn [])
|
|
||||||
val) )
|
|
||||||
;; just do fmap of boards
|
|
||||||
())
|
|
||||||
)
|
|
||||||
|
|
||||||
(defn get-some-config
|
(defn get-some-config
|
||||||
"Attempts to get config somehow,
|
"Attempts to get config somehow,
|
||||||
first from command line argument
|
first from command line argument
|
||||||
|
@ -82,10 +67,8 @@
|
||||||
(let [file-to-try (u/nil?-else (first cmd-args)
|
(let [file-to-try (u/nil?-else (first cmd-args)
|
||||||
"./config.edn")]
|
"./config.edn")]
|
||||||
(u/when-else (load-config file-to-try)
|
(u/when-else (load-config file-to-try)
|
||||||
(println "WARN: Using default internal config because suggessted file: '" file-to-try "' not found.")
|
(println "WARN: Using default internal config because suggessted " file-to-try " not found.")
|
||||||
CONFIG-DEFAULT)))
|
CONFIG-DEFAULT)))
|
||||||
;;TODO: We want to copy default board-local config into every board, that way we won't have to always look
|
|
||||||
;; into defaults, but
|
|
||||||
|
|
||||||
;; Todo: Add option to write default config to stdout
|
;; Todo: Add option to write default config to stdout
|
||||||
(defn -main
|
(defn -main
|
||||||
|
|
|
@ -19,16 +19,10 @@
|
||||||
(:gen-class))
|
(:gen-class))
|
||||||
|
|
||||||
(def chod-threads-cache
|
(def chod-threads-cache
|
||||||
"Cached map of threads that have CHanceOfDeath > configured"
|
"Cached vector of threads that have CHanceOfDeath > configured"
|
||||||
nil)
|
(atom []))
|
||||||
|
|
||||||
(def time-of-cache nil)
|
(def time-of-cache (atom 0))
|
||||||
|
|
||||||
(defn init-global-cache
|
|
||||||
"Initializes global cache of catalogs"
|
|
||||||
[config]
|
|
||||||
(keys (:boards-enabled config))
|
|
||||||
)
|
|
||||||
|
|
||||||
(defn process-page
|
(defn process-page
|
||||||
"Procesess every thread in page, leaving only relevant information
|
"Procesess every thread in page, leaving only relevant information
|
||||||
|
|
Loading…
Reference in a new issue