From e26b8408f6e359540338a884b52d1a478dbba89b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kier=C3=A1n=20Meinhardt?= Date: Tue, 8 Oct 2024 18:46:25 +0200 Subject: [PATCH] smyth: post url --- configs/telegram-bots/smyth.nix | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/configs/telegram-bots/smyth.nix b/configs/telegram-bots/smyth.nix index f247115..81689d1 100644 --- a/configs/telegram-bots/smyth.nix +++ b/configs/telegram-bots/smyth.nix @@ -28,10 +28,13 @@ | ${pkgs.gnused}/bin/sed 's/^ref="//;s/"$//' ) - ${pkgs.curl}/bin/curl -sSL http://www.perseus.tufts.edu/hopper/text?doc=$RANDOM_SECTION\ + url="http://www.perseus.tufts.edu/hopper/text?doc=$RANDOM_SECTION" + ${pkgs.curl}/bin/curl -sSL "$url"\ | ${pkgs.htmlq}/bin/htmlq '#text_main' \ | ${pkgs.gnused}/bin/sed 's/<\/\?hr>//g' \ | ${pkgs.pandoc}/bin/pandoc -f html -t plain --wrap=none + + printf '\n%s\n\n#AncientGreek' "$url" ''); };