mirror of
https://codeberg.org/cage/tinmop/
synced 2025-02-02 04:36:43 +01:00
- added a script to import and export gemlog subscriptions;
- prevented printing diagnostic message if the program is executing a script.
This commit is contained in:
parent
8da549e127
commit
9e62a10995
29
scripts/export-gemini-subscriptions.lisp
Normal file
29
scripts/export-gemini-subscriptions.lisp
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
;; follow a list of users
|
||||||
|
;; Copyright © 2021 cage
|
||||||
|
|
||||||
|
;; This program is free software: you can redistribute it and/or modify
|
||||||
|
;; it under the terms of the GNU General Public License as published by
|
||||||
|
;; the Free Software Foundation, either version 3 of the License, or
|
||||||
|
;; (at your option) any later version.
|
||||||
|
|
||||||
|
;; This program is distributed in the hope that it will be useful,
|
||||||
|
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
;; GNU General Public License for more details.
|
||||||
|
|
||||||
|
;; You should have received a copy of the GNU General Public License
|
||||||
|
;; along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
;; usage:
|
||||||
|
|
||||||
|
;; tinmop -e export-gemini-subscriptions.lisp
|
||||||
|
|
||||||
|
(in-package :scripts)
|
||||||
|
|
||||||
|
(defun main ()
|
||||||
|
(db-utils:with-ready-database (:connect t)
|
||||||
|
(let ((all-subscriptions (db:gemini-all-subscriptions)))
|
||||||
|
(loop for row in all-subscriptions do
|
||||||
|
(format t "~a~%" (db-utils:db-getf row :url))))))
|
||||||
|
|
||||||
|
(main)
|
38
scripts/import-gemini-subscriptions.lisp
Normal file
38
scripts/import-gemini-subscriptions.lisp
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
;; follow a list of users
|
||||||
|
;; Copyright © 2021 cage
|
||||||
|
|
||||||
|
;; This program is free software: you can redistribute it and/or modify
|
||||||
|
;; it under the terms of the GNU General Public License as published by
|
||||||
|
;; the Free Software Foundation, either version 3 of the License, or
|
||||||
|
;; (at your option) any later version.
|
||||||
|
|
||||||
|
;; This program is distributed in the hope that it will be useful,
|
||||||
|
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
;; GNU General Public License for more details.
|
||||||
|
|
||||||
|
;; You should have received a copy of the GNU General Public License
|
||||||
|
;; along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
;; usage:
|
||||||
|
|
||||||
|
;; after configuring tinmop (https://www.autistici.org/interzona/tinmop.html)
|
||||||
|
;; tinmop -e import-gemini-subscriptions.lisp < subscriptions
|
||||||
|
;; the file must be in the format
|
||||||
|
;; gemlog-url newline
|
||||||
|
;; gemlog-url-2 newline
|
||||||
|
;; gemlog-url-3 newline
|
||||||
|
;; etc.
|
||||||
|
|
||||||
|
(in-package :scripts)
|
||||||
|
|
||||||
|
(defun main ()
|
||||||
|
(db-utils:with-ready-database (:connect t)
|
||||||
|
(loop for line = (read-line *standard-input* nil nil nil)
|
||||||
|
while line do
|
||||||
|
(let* ((url (text-utils:trim-blanks line)))
|
||||||
|
(format t "Subscribing to: ~a…" url)
|
||||||
|
(gemini-subscription:subscribe url)
|
||||||
|
(format t "Done~%")))))
|
||||||
|
|
||||||
|
(main)
|
@ -95,7 +95,10 @@ etc.) happened"
|
|||||||
(ui:reset-timeline-pagination))
|
(ui:reset-timeline-pagination))
|
||||||
|
|
||||||
(defun load-configuration-files ()
|
(defun load-configuration-files ()
|
||||||
(format t (_ "Loading configuration file ~a~%") swconf:+shared-conf-filename+)
|
(when (not command-line:*script-file*)
|
||||||
|
(format t
|
||||||
|
(_ "Loading configuration file ~a~%")
|
||||||
|
swconf:+shared-conf-filename+))
|
||||||
(handler-case
|
(handler-case
|
||||||
(multiple-value-bind (x configuration-file-path)
|
(multiple-value-bind (x configuration-file-path)
|
||||||
(swconf:load-config-file swconf:+shared-conf-filename+)
|
(swconf:load-config-file swconf:+shared-conf-filename+)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user