|
|
@ -24,7 +24,7 @@ Use cl-rng to pick a random page from the lolibooru API"
|
|
|
|
(cl-ppcre:register-groups-bind (url)
|
|
|
|
(cl-ppcre:register-groups-bind (url)
|
|
|
|
("(?:file_url\":\")(.*?)(?:\",)"
|
|
|
|
("(?:file_url\":\")(.*?)(?:\",)"
|
|
|
|
(dex:get (str "https://lolibooru.moe/post/index.json?tags=rating:"
|
|
|
|
(dex:get (str "https://lolibooru.moe/post/index.json?tags=rating:"
|
|
|
|
(or (cl-ppcre:scan-to-strings "-?[sqe]" rating) "s")
|
|
|
|
(or (cl-ppcre:scan-to-strings "^-?[sqe]$" rating) "s")
|
|
|
|
"+-3dcg+-rape&limit=1&page="
|
|
|
|
"+-3dcg+-rape&limit=1&page="
|
|
|
|
(write-to-string (cl-rng:crandom :limit 25000 :transform 'floor)))))
|
|
|
|
(write-to-string (cl-rng:crandom :limit 25000 :transform 'floor)))))
|
|
|
|
(cl-ppcre:regex-replace-all "\\\\/" url "/")))
|
|
|
|
(cl-ppcre:regex-replace-all "\\\\/" url "/")))
|
|
|
@ -46,18 +46,26 @@ Use cl-rng to pick a random page from the lolibooru API"
|
|
|
|
(:a :id "about" :href "/loli/about" "about")))
|
|
|
|
(:a :id "about" :href "/loli/about" "about")))
|
|
|
|
x))
|
|
|
|
x))
|
|
|
|
|
|
|
|
|
|
|
|
(henh:host-file "/loli/about" "about.html" @html)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(defun configure ()
|
|
|
|
(defun configure ()
|
|
|
|
(setf *serb* (make-instance 'hunchentoot:easy-acceptor
|
|
|
|
(setf *serb* (make-instance 'hunchentoot:easy-acceptor
|
|
|
|
:port (config-item :port)
|
|
|
|
:port (config-item :port)
|
|
|
|
:document-root (config-item :document-root))))
|
|
|
|
:document-root (config-item :document-root)
|
|
|
|
|
|
|
|
;; We (eval) these because quoting streams is werid.
|
|
|
|
|
|
|
|
;; '*standard-ouput* is not of type stream why?
|
|
|
|
|
|
|
|
:access-log-destination (eval (config-item :access-log))
|
|
|
|
|
|
|
|
:message-log-destination (eval (config-item :error-log)))))
|
|
|
|
|
|
|
|
|
|
|
|
(defun start ()
|
|
|
|
(defun start ()
|
|
|
|
(handler-case (configure)
|
|
|
|
(handler-case (configure)
|
|
|
|
(error (e) "Configuration failed: ~a" e))
|
|
|
|
(error (e) "Configuration failed: ~a" e))
|
|
|
|
|
|
|
|
(when (null *serb*)
|
|
|
|
|
|
|
|
(error "Serb is nill? ehh?"))
|
|
|
|
(hunchentoot:start *serb*))
|
|
|
|
(hunchentoot:start *serb*))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(defun stop ()
|
|
|
|
|
|
|
|
(hunchentoot:stop *serb*))
|
|
|
|
|
|
|
|
|
|
|
|
(export '(configure
|
|
|
|
(export '(configure
|
|
|
|
start
|
|
|
|
start
|
|
|
|
|
|
|
|
stop
|
|
|
|
*serb*))
|
|
|
|
*serb*))
|
|
|
|