Skip to content

Commit

Permalink
Small change to utilities
Browse files Browse the repository at this point in the history
  • Loading branch information
abraemer committed Dec 23, 2018
1 parent 18b63b1 commit c1b88a8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion advent-of-code-2018.asd
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
:license "Specify license here"
:version "0.0.1"
:serial t
:depends-on ("cl-ppcre")
:depends-on ("cl-ppcre" "drakma")
:components ((:file "package")
(:file "utilities")
(:file "day1")
Expand Down
4 changes: 2 additions & 2 deletions utilities.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
(defconstant +path+ "D:/Daten/lisp/advent-of-code-2018/inputs/")

(defun download-puzzle-input (day file)
(ql:quickload :drakma)
(let ((session-file (puzzlepath "session.txt"))
(cookie-jar (make-instance 'drakma:cookie-jar)))
(unless (probe-file session-file)
Expand All @@ -18,7 +17,8 @@
(drakma:cookie-jar-cookies cookie-jar))
(destructuring-bind (body code . stuff)
(multiple-value-list
(drakma:http-request (format nil "https://adventofcode.com/2018/day/~d/input" day) :cookie-jar jar))
(drakma:http-request (format nil "https://adventofcode.com/2018/day/~d/input" day)
:cookie-jar cookie-jar))
(unless (= code 200)
(format t "Somnething went wrong! Return status code: ~a (~a)~%" code (first (last stuff)))
(return-from download-puzzle-input))
Expand Down

0 comments on commit c1b88a8

Please sign in to comment.