This commit is contained in:
Chris Cochrun 2026-05-08 14:24:33 -05:00
parent 4a94a6f103
commit bc0987c09a
8 changed files with 419 additions and 0 deletions

View file

@ -1,3 +1,4 @@
<<<<<<< HEAD
;; #!/run/current-system/sw/bin/sbcl --script
;; (load "~/quicklisp/setup.lisp")
@ -7,20 +8,39 @@
(loop for i from 748 to 1489 do
(let* ((request (drakma:http-request
(concatenate 'string "https://www.lfg.co/page/" (write-to-string i))))
=======
#!/usr/bin/env -S sbcl --script
(load "~/quicklisp/setup.lisp")
(ql:quickload '(drakma lquery))
(defun get-images ()
(loop for i from 1490 to 1734 do
(let* ((request (drakma:http-request
(concatenate 'string "https://www.lfg.co/read/comic/" (write-to-string i))))
>>>>>>> 4827e2d (updates?)
(parsed-content (lquery:$ (lquery:initialize request)))
(url (vector-pop (lquery:$ parsed-content "img" (attr :src))))
(img (drakma:http-request url)))
(if (not (search ".jpg" url))
(with-open-file (stream
<<<<<<< HEAD
(concatenate 'string "/home/chris/Pictures/lfg/" (write-to-string i) ".gif")
=======
(concatenate 'string "/home/chris/pics/lfg/" (write-to-string i) ".gif")
>>>>>>> 4827e2d (updates?)
:direction :output
:if-exists :supersede
:if-does-not-exist :create
:element-type 'unsigned-byte)
(write-sequence img stream))
(with-open-file (stream
<<<<<<< HEAD
(concatenate 'string "/home/chris/Pictures/lfg/" (write-to-string i) ".jpg")
=======
(concatenate 'string "/home/chris/pics/lfg/" (write-to-string i) ".jpg")
>>>>>>> 4827e2d (updates?)
:direction :output
:if-exists :supersede
:if-does-not-exist :create