From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: DKIM-Signature: a=rsa-sha256; bh=hJdY4BI0Y0Lmx7vhGBQwrM/WdSSnGKQ78Pb4fowq1Sc=; c=relaxed/relaxed; d=nullring.xyz; h=Subject:Subject:Sender:To:To:Cc:Cc:From:From:Date:Date:MIME-Version:MIME-Version:Content-Type:Content-Transfer-Encoding:Content-Transfer-Encoding:Reply-To:In-Reply-To:Message-Id:Message-Id:References:Autocrypt:Openpgp; i=@nullring.xyz; s=default; t=1771319952; v=1; x=1771751952; b=VPuROjrRSjHVFzL6t3l0HxOrsS3ZekmofIBQ58M+itzxxgkxGAuZTqq1RH6Y8CulNisnLS7R w+w/cSiBjjTBCzwypissgpK65ACqLBFuklKqebOzB/aXY6PWnJPdvMqSBZnP1BPjaNCVZMMYjAQ s83oH5S27GQkLap1o9ol3ng9c4Srr2sKOxOzO4NlUd1SWkcSZcsqB0cNunJfRkyfIRRPKXXTdye b4N3yRGfgKOicxhoTYSS8doyubdWVJMurHEqAaImTp2vE4zCEBDmDbJbkfZ43UZHnfpk40qW3np 7ZvEICXHYjP1QZfXxEDUwuwzhZX98SYme338GisUH/cRg== Received: by nullring.xyz (envelope-sender ) with ESMTPS id aff0a8c0; Tue, 17 Feb 2026 01:19:12 -0800 From: Preston Pan To: discussion@nullring.xyz Cc: andreisva2023@gmail.com, Preston Pan Subject: [PATCH] abstractions for different cities Date: Tue, 17 Feb 2026 01:19:00 -0800 Message-ID: <20260217091900.101608-1-ret2pop@nullring.xyz> X-Mailer: git-send-email 2.52.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit --- 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