From 0f0a6935ac7e378211d85c617ed3eb51f1b16282 Mon Sep 17 00:00:00 2001 From: cage Date: Sun, 20 Feb 2022 14:40:35 +0100 Subject: [PATCH] - added script 'gemget.lisp'. --- Makefile.am | 15 ++++++++------- Makefile.in | 15 ++++++++------- scripts/gemget.lisp | 30 ++++++++++++++++++++++++++++++ 3 files changed, 46 insertions(+), 14 deletions(-) create mode 100644 scripts/gemget.lisp diff --git a/Makefile.am b/Makefile.am index 4e5eb28..2a3b312 100644 --- a/Makefile.am +++ b/Makefile.am @@ -42,16 +42,17 @@ confdir = $(sysconfdir)/$(PACKAGE) dist_conf_DATA = etc/init.lisp etc/default-theme.conf etc/shared.conf -dist_pkgdata_DATA = scripts/export-gemini-subscriptions.lisp \ -scripts/get-following.lisp \ -scripts/import-following.lisp \ -scripts/import-gemini-subscriptions.lisp \ -scripts/welcome-bot.lisp \ -modules/delete-by-regex.lisp \ +dist_pkgdata_DATA = modules/delete-by-regex.lisp \ modules/expand-abbrev-command-window.lisp \ modules/next-previous-open.lisp \ modules/rewrite-message-urls.lisp \ -modules/share-gemini-link.lisp +modules/share-gemini-link.lisp \ +scripts/export-gemini-subscriptions.lisp \ +scripts/gemget.lisp \ +scripts/get-following.lisp \ +scripts/import-following.lisp \ +scripts/import-gemini-subscriptions.lisp \ +scripts/welcome-bot.lisp dist_man1_MANS = doc/tinmop.man diff --git a/Makefile.in b/Makefile.in index ff685c9..0db4ea2 100644 --- a/Makefile.in +++ b/Makefile.in @@ -404,16 +404,17 @@ doc/man.org doc/send-toot.lisp NEWS.org ChangeLog AUTHORS confdir = $(sysconfdir)/$(PACKAGE) dist_conf_DATA = etc/init.lisp etc/default-theme.conf etc/shared.conf -dist_pkgdata_DATA = scripts/export-gemini-subscriptions.lisp \ -scripts/get-following.lisp \ -scripts/import-following.lisp \ -scripts/import-gemini-subscriptions.lisp \ -scripts/welcome-bot.lisp \ -modules/delete-by-regex.lisp \ +dist_pkgdata_DATA = modules/delete-by-regex.lisp \ modules/expand-abbrev-command-window.lisp \ modules/next-previous-open.lisp \ modules/rewrite-message-urls.lisp \ -modules/share-gemini-link.lisp +modules/share-gemini-link.lisp \ +scripts/export-gemini-subscriptions.lisp \ +scripts/gemget.lisp \ +scripts/get-following.lisp \ +scripts/import-following.lisp \ +scripts/import-gemini-subscriptions.lisp \ +scripts/welcome-bot.lisp dist_man1_MANS = doc/tinmop.man all: $(BUILT_SOURCES) diff --git a/scripts/gemget.lisp b/scripts/gemget.lisp new file mode 100644 index 0000000..78d1f7b --- /dev/null +++ b/scripts/gemget.lisp @@ -0,0 +1,30 @@ +;; slurp a gemini url +;; 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 . + +;; usage: + +;; echo URL | tinmop -e gemget.lisp + +(in-package :scripts) + +(defun main () + (handler-case + (let ((url (read-line *standard-input* nil nil nil))) + (write-sequence (gemini-client:slurp-gemini-url url) *standard-output*) + (os-utils:exit-program 0)) + (error () (os-utils:exit-program 1)))) + +(main)