Main Nullring Discussion Mailing List
 help / color / mirror / Atom feed
From: Preston Pan <ret2pop@nullring.xyz>
To: discussion@nullring.xyz
Cc: andreisva2023@gmail.com, Preston Pan <ret2pop@nullring.xyz>
Subject: [PATCH] abstractions for different cities
Date: Tue, 17 Feb 2026 01:19:00 -0800	[thread overview]
Message-ID: <20260217091900.101608-1-ret2pop@nullring.xyz> (raw)

---
 src/main.lisp | 9 +++++----
 1 file 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
-- 
2.52.0


                 reply	other threads:[~2026-02-17  9:19 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260217091900.101608-1-ret2pop@nullring.xyz \
    --to=ret2pop@nullring.xyz \
    --cc=andreisva2023@gmail.com \
    --cc=discussion@nullring.xyz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox