diff options
| author | Preston Pan <ret2pop@nullring.xyz> | 2026-02-17 14:30:04 -0800 |
|---|---|---|
| committer | Andrei <andreisva2023@gmail.com> | 2026-02-17 17:58:00 -0800 |
| commit | 3d88f046acc11161fee91775ef836174dbb0ca61 (patch) | |
| tree | ba84a944f8a29f0540735952beec476db089ab61 /src/main.lisp | |
| parent | fa36cd0ffe22728141755e4c4e1d5cdc2d5ee148 (diff) | |
Signed-off-by: Andrei <andreisva2023@gmail.com>
Diffstat (limited to 'src/main.lisp')
| -rw-r--r-- | src/main.lisp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/main.lisp b/src/main.lisp index d789921..fb74901 100644 --- a/src/main.lisp +++ b/src/main.lisp @@ -19,12 +19,13 @@ (defparameter +feed-room-id+ "!ShuXi5ohrPUtKHkrNO:matrix.nullring.xyz") (defparameter +feed-cache-path+ #P"./nullbot_cache.sexp") (defparameter +feed-sleep-minutes+ 1) +(defparameter +weather-vancouver+ ) (defparameter +prefix+ "$") -(defun get-temp - (&aux - (endpoint "https://api.weather.gc.ca/collections/swob-realtime/items?f=json&lang=en&url=CYVR&sortby=-date_tm-value&limit=1&properties=date_tm-value,air_temp,air_temp-uom,air_temp-qa") +(defun get-temp (weather-station + &aux + (endpoint (format nil "https://api.weather.gc.ca/collections/swob-realtime/items?f=json&lang=en&url=C~A&sortby=-date_tm-value&limit=1&properties=date_tm-value,air_temp,air_temp-uom,air_temp-qa" weather-station)) (data (jzon:parse (dex:get endpoint)))) (hash-get (aref (gethash "features" data) 0) '("properties" "air_temp"))) @@ -41,7 +42,7 @@ ((string= command "$help") (mapi:sendmsg *bot* room-id "Unlike some other bots, I'm nice :3")) ((string= command "$weather") - (mapi:sendmsg *bot* room-id (format nil "It's ~a degrees in Vancouver" (get-temp))))))) + (mapi:sendmsg *bot* room-id (format nil "It's ~a degrees in Vancouver~%It's ~a degrees in Victoria" (get-temp "YVR") (get-temp "YYJ"))))))) (defmethod mapi:on-event ((obj nullbot) event room-id |
