iUpdates for fediverse scripts. - gopher-lawn - The gopher lawn gopher directory project. Err bitreich.org 70 hgit clone git://bitreich.org/gopher-lawn/ git://enlrupgkhuxnvlhsf6lc3fziv5h2hhfrinws65d7roiv6bfj7d652fid.onion/gopher-lawn/ URL:git://bitreich.org/gopher-lawn/ git://enlrupgkhuxnvlhsf6lc3fziv5h2hhfrinws65d7roiv6bfj7d652fid.onion/gopher-lawn/ bitreich.org 70 1Log /scm/gopher-lawn/log.gph bitreich.org 70 1Files /scm/gopher-lawn/files.gph bitreich.org 70 1Refs /scm/gopher-lawn/refs.gph bitreich.org 70 1Tags /scm/gopher-lawn/tag bitreich.org 70 i--- Err bitreich.org 70 1commit af8e61f070664bd1ea1743d4ce06223550390e22 /scm/gopher-lawn/commit/af8e61f070664bd1ea1743d4ce06223550390e22.gph bitreich.org 70 1parent e3cc5279072ddbee7f2d58152732c759a9ede582 /scm/gopher-lawn/commit/e3cc5279072ddbee7f2d58152732c759a9ede582.gph bitreich.org 70 hAuthor: Julian Schweinsberg URL:mailto:pazz0@0xfa.de bitreich.org 70 iDate: Mon, 25 Dec 2023 15:52:33 +0100 Err bitreich.org 70 i Err bitreich.org 70 iUpdates for fediverse scripts. Err bitreich.org 70 i Err bitreich.org 70 i1. get-pleroma-instances.sh: Use the new "fancy" GraphQL-thingie of Err bitreich.org 70 i fediverse.observer. The old API doesn't seem to exist anymore. Uses Err bitreich.org 70 i json2tsv's jaq. May be overengineered. Err bitreich.org 70 i2. check-for-gopher-service.sh: Reduce false positives by checking for Err bitreich.org 70 i the port 9999 in the nc output. Err bitreich.org 70 i Err bitreich.org 70 iSigned-off-by: Christoph Lohmann <20h@r-36.net> Err bitreich.org 70 i Err bitreich.org 70 iDiffstat: Err bitreich.org 70 i M fediverse/check-for-gopher-service… | 2 +- Err bitreich.org 70 i M fediverse/get-pleroma-instances.sh | 17 +++++++++++------ Err bitreich.org 70 i Err bitreich.org 70 i2 files changed, 12 insertions(+), 7 deletions(-) Err bitreich.org 70 i--- Err bitreich.org 70 1diff --git a/fediverse/check-for-gopher-service.sh b/fediverse/check-for-gopher-service.sh /scm/gopher-lawn/file/fediverse/check-for-gopher-service.sh.gph bitreich.org 70 i@@ -7,5 +7,5 @@ then Err bitreich.org 70 i fi Err bitreich.org 70 i Err bitreich.org 70 i shuf "$1" \ Err bitreich.org 70 i- | xargs -I '{}' -P 16 sh -c 'server={}; printf "\r\n" | nc -w 5 ${server} 9999 >/dev/null 2>&1 && printf "%s serves gopher\n" "${server}";' Err bitreich.org 70 i+ | xargs -I '{}' -P 16 sh -c 'server={}; printf "\r\n" | nc -w 5 ${server} 9999 2>&1 | grep -q 9999 && printf "%s serves gopher\n" "${server}";' Err bitreich.org 70 i Err bitreich.org 70 1diff --git a/fediverse/get-pleroma-instances.sh b/fediverse/get-pleroma-instances.sh /scm/gopher-lawn/file/fediverse/get-pleroma-instances.sh.gph bitreich.org 70 i@@ -1,7 +1,12 @@ Err bitreich.org 70 i #!/bin/sh Err bitreich.org 70 i- Err bitreich.org 70 i-curl -s https://pleroma.fediverse.observer/app/views/tabledata.php?software=pleroma \ Err bitreich.org 70 i- | sed -e 's,app/views/podstat-user-counts.php?,\n,g' \ Err bitreich.org 70 i- | grep "^domain=" \ Err bitreich.org 70 i- | sed 's,^domain=\([^" ]*\).*,\1,' Err bitreich.org 70 i- Err bitreich.org 70 i+sed 's,",\\",g; s,$,\\n,' <<-EOF \ Err bitreich.org 70 i+ | tr -d '\n' \ Err bitreich.org 70 i+ | sed 's,^\(.*\)$,{"query":"\1"},' \ Err bitreich.org 70 i+ | curl -s -H'Content-Type: application/json' --data-binary @- https://api.fediverse.observer/ \ Err bitreich.org 70 i+ | jaq '$1 == ".data.nodes[].domain" { print $3 }' Err bitreich.org 70 i+{ Err bitreich.org 70 i+ nodes(softwarename: "pleroma", status: "UP") { Err bitreich.org 70 i+ domain Err bitreich.org 70 i+ } Err bitreich.org 70 i+} Err bitreich.org 70 i+EOF Err bitreich.org 70 .