From e6860d458246d837dd6f001d18fc9c9bbc6d4bb7 Mon Sep 17 00:00:00 2001 From: mehbark Date: Fri, 3 Jan 2025 11:44:44 -0500 Subject: [PATCH] counthost --- counthost.lisp | 19 +++++++++++++++++++ utils.lisp | 2 -- 2 files changed, 19 insertions(+), 2 deletions(-) create mode 100644 counthost.lisp diff --git a/counthost.lisp b/counthost.lisp new file mode 100644 index 0000000..edebc45 --- /dev/null +++ b/counthost.lisp @@ -0,0 +1,19 @@ +;; TODO: make this unnecessary for `sbcl --script` invocations +(let ((quicklisp-init (merge-pathnames "quicklisp/setup.lisp" + (user-homedir-pathname)))) + (when (probe-file quicklisp-init) + (load quicklisp-init))) + +(load "utils.lisp") + +(defun account-exists? (n) + (begin + (= (values _ _ status) + (uiop:run-program + (format nil "curl --head --fail https://cohost.org/~r" n) + :ignore-error-status t)) + (zerop status))) + +(loop for i below 100 + do (format t "~a @~r~%" (if (account-exists? i) "∃" "∄") i) + do (sleep 0.1)) diff --git a/utils.lisp b/utils.lisp index 6f099d1..a410761 100644 --- a/utils.lisp +++ b/utils.lisp @@ -742,5 +742,3 @@ ,@(when (member '$@ money) '(&rest $@))) ,@body))) - -(begin (=f x2 (n) (+ n n)) (fpromote x2) (mapcar x2 '(1 2 3)))