Created
September 26, 2023 16:59
-
-
Save bo-tato/9df8182150dc49d0943f13635430b647 to your computer and use it in GitHub Desktop.
#commonlisp irc archive reader
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(in-package :ciel-user) | |
(use-package '(local-time periods)) | |
(import 'periods::do-times) | |
(defconstant +last-date-file+ "~/.irc-log-reader-last") | |
(defun fmt-date (date) | |
(format-timestring nil date :format +rfc3339-format/date-only+)) | |
(do-times (day (-> +last-date-file+ str:from-file str:trim parse-timestring) | |
(duration :days 1) | |
(today)) | |
(let* ((url #?"https://libera.irclog.whitequark.org/commonlisp/${(fmt-date day)}") | |
(doc (lquery:$ (initialize (dex:get url))))) | |
(format t "~%:: ~a ::~%" day) | |
(lquery:$ doc ".talk.op-msg" (text) | |
(map [#'println {substitute #\Space #\Newline}])))) | |
(str:to-file +last-date-file+ (fmt-date (today))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment