diff options
author | Erich Eckner <git@eckner.net> | 2020-04-21 08:06:14 +0200 |
---|---|---|
committer | Erich Eckner <git@eckner.net> | 2020-04-21 08:06:14 +0200 |
commit | dc3af2a3d59785ab77fcc0058f1349e47529cf18 (patch) | |
tree | 71ca50475ace09717a5389e4ae307148ade89d74 | |
parent | b2233f93e455021d17603c53abf37a193bf2d50d (diff) | |
download | show-irc-log-dc3af2a3d59785ab77fcc0058f1349e47529cf18.tar.xz |
show-irc-log: use curl instead of sshfs
-rwxr-xr-x | show-irc-log | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/show-irc-log b/show-irc-log index 350c59d..5edc39c 100755 --- a/show-irc-log +++ b/show-irc-log @@ -3,17 +3,17 @@ tmp_dir=$(mktemp -d) trap 'rm -rf --one-file-system "${tmp_dir}"' EXIT -if ! mountpoint -q /mnt/archlinux32; then - exit -fi - -find /mnt/archlinux32/irc-logs/#archlinux32/ \ - -type f \ - -mtime -4 \ - -name '*-*-*.html' | \ - sort | \ - while read -r s; do - sed -n ' +curl -Ss 'https://mirror.archlinux32.org/irc-logs/%23archlinux32/' \ +| sed ' + s@^<a href="\([-0-9]\+\)\.html">\1</a>$@\1@ + t + d +' \ +| sort -r \ +| tail -n4 \ +| while read -r s; do + curl -Ss 'https://mirror.archlinux32.org/irc-logs/%23archlinux32/'"${s}"'.html' \ + | sed -n ' s|^.* <span class="person" style="[^"]\+"><\([^&]\+\)></span>|\1 \|| t ok s|^.* <span class="person" style="[^"]\+">\* \(\S\+\) \(.*\)</span>.*$|\1 : \2| @@ -21,10 +21,10 @@ find /mnt/archlinux32/irc-logs/#archlinux32/ \ T :ok p - ' "${s}" - done | \ - tail -n30 > \ - "${tmp_dir}/input" + ' + done \ +| tail -n30 \ +> "${tmp_dir}/input" sed -n ' s@[|:].*$@|@ |