|
|
@ -1,12 +1,10 @@
|
|
|
|
(mapc
|
|
|
|
(ql:quickload :aserve)
|
|
|
|
(lambda (x) (ql:quickload x))
|
|
|
|
(ql:quickload :dexador)
|
|
|
|
'(:cl-rng
|
|
|
|
(ql:quickload :jsown)
|
|
|
|
:manx-utils
|
|
|
|
(ql:quickload :qbase64)
|
|
|
|
:cl-ppcre
|
|
|
|
(ql:quickload :cl-ppcre)
|
|
|
|
:aserve
|
|
|
|
(ql:quickload :cl-rng)
|
|
|
|
:dexador
|
|
|
|
(ql:quickload :manx-utils)
|
|
|
|
:jsown
|
|
|
|
|
|
|
|
:qbase64))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(load #p"config.lisp")
|
|
|
|
(load #p"config.lisp")
|
|
|
|
|
|
|
|
|
|
|
@ -38,16 +36,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
(loop (sleep 10000)))
|
|
|
|
(loop (sleep 10000)))
|
|
|
|
|
|
|
|
|
|
|
|
(defun loli-rating (req)
|
|
|
|
(defun loli-rating (rating)
|
|
|
|
(let ((rating (net.aserve:request-query-value "rating" req)))
|
|
|
|
|
|
|
|
(or (cl-ppcre:scan-to-strings "-?(s|q|e)" rating)
|
|
|
|
(or (cl-ppcre:scan-to-strings "-?(s|q|e)" rating)
|
|
|
|
"s")))
|
|
|
|
"s"))
|
|
|
|
|
|
|
|
|
|
|
|
(defun based-loli (req)
|
|
|
|
(defun based-loli (req)
|
|
|
|
(manx-utils:to-string
|
|
|
|
(manx-utils:to-string
|
|
|
|
"data:image/jpg;base64,"
|
|
|
|
"data:image/jpg;base64,"
|
|
|
|
(qbase64:encode-bytes
|
|
|
|
(qbase64:encode-bytes
|
|
|
|
(dex:get (get-loli (loli-rating req))))))
|
|
|
|
(dex:get (get-loli
|
|
|
|
|
|
|
|
(loli-rating (net.aserve:request-query-value "rating" req)))))))
|
|
|
|
|
|
|
|
|
|
|
|
(defun this-is-bad-code (req ent)
|
|
|
|
(defun this-is-bad-code (req ent)
|
|
|
|
(net.aserve:with-http-response (req ent)
|
|
|
|
(net.aserve:with-http-response (req ent)
|
|
|
@ -59,6 +57,6 @@
|
|
|
|
((:body :style "position:relative")
|
|
|
|
((:body :style "position:relative")
|
|
|
|
((:img :style "object-fit: contain; width: 100%; height:100%"
|
|
|
|
((:img :style "object-fit: contain; width: 100%; height:100%"
|
|
|
|
:src (based-loli req)))
|
|
|
|
:src (based-loli req)))
|
|
|
|
((:a :style "position:absolute;top:8px;right:16px;" href "/loli/about") "about")))))))
|
|
|
|
((:a :style "position:absolute;top:8px;right:16px;" href "/loli/about") "about"))))))
|
|
|
|
|
|
|
|
(gc :full t)) ;; Removes downloaded files from memory
|
|
|
|
(main)
|
|
|
|
(main)
|
|
|
|