45 lines
1 KiB
Common Lisp
45 lines
1 KiB
Common Lisp
|
(defpackage aoc
|
||
|
(:use :cl))
|
||
|
(in-package :aoc)
|
||
|
|
||
|
(defun load-ql-dependencies ()
|
||
|
())
|
||
|
|
||
|
|
||
|
(defvar *aoc-url* "https://adventofcode.com")
|
||
|
|
||
|
|
||
|
(defvar *cookie-jar*
|
||
|
(cl-cookie:make-cookie-jar
|
||
|
:cookies (list
|
||
|
(cl-cookie:make-cookie
|
||
|
:name "session"
|
||
|
:value (uiop:getenv "AOC_SESSION")
|
||
|
:origin-host "adventofcode.com"
|
||
|
:path "/"
|
||
|
:domain ".adventofcode.com"
|
||
|
:secure-p t))))
|
||
|
|
||
|
(setf *cookie-jar*
|
||
|
(cl-cookie:make-cookie-jar
|
||
|
:cookies (list
|
||
|
(cl-cookie:make-cookie
|
||
|
:name "session"
|
||
|
:value (uiop:getenv "AOC_SESSION")
|
||
|
:origin-host "adventofcode.com"
|
||
|
:path "/"
|
||
|
:domain ".adventofcode.com"
|
||
|
:secure-p t))))
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
(defun test-input (year day)
|
||
|
(let ((url (format nil "~A/~D/day/~D/input" *aoc-url* year day)))
|
||
|
(multiple-value-bind
|
||
|
(body)
|
||
|
(dex:get url :cookie-jar *cookie-jar* :verbose t)
|
||
|
body)))
|
||
|
|
||
|
|