Updates for fediverse scripts. - gopher-lawn - The gopher lawn gopher directory… | |
git clone git://bitreich.org/gopher-lawn/ git://enlrupgkhuxnvlhsf6lc3fziv5h2hhf… | |
Log | |
Files | |
Refs | |
Tags | |
--- | |
commit af8e61f070664bd1ea1743d4ce06223550390e22 | |
parent e3cc5279072ddbee7f2d58152732c759a9ede582 | |
Author: Julian Schweinsberg <[email protected]> | |
Date: Mon, 25 Dec 2023 15:52:33 +0100 | |
Updates for fediverse scripts. | |
1. get-pleroma-instances.sh: Use the new "fancy" GraphQL-thingie of | |
fediverse.observer. The old API doesn't seem to exist anymore. Uses | |
json2tsv's jaq. May be overengineered. | |
2. check-for-gopher-service.sh: Reduce false positives by checking for | |
the port 9999 in the nc output. | |
Signed-off-by: Christoph Lohmann <[email protected]> | |
Diffstat: | |
M fediverse/check-for-gopher-service⦠| 2 +- | |
M fediverse/get-pleroma-instances.sh | 17 +++++++++++------ | |
2 files changed, 12 insertions(+), 7 deletions(-) | |
--- | |
diff --git a/fediverse/check-for-gopher-service.sh b/fediverse/check-for-gopher… | |
@@ -7,5 +7,5 @@ then | |
fi | |
shuf "$1" \ | |
- | xargs -I '{}' -P 16 sh -c 'server={}; printf "\r\n" | nc -w 5 ${serv… | |
+ | xargs -I '{}' -P 16 sh -c 'server={}; printf "\r\n" | nc -w 5 ${serv… | |
diff --git a/fediverse/get-pleroma-instances.sh b/fediverse/get-pleroma-instanc… | |
@@ -1,7 +1,12 @@ | |
#!/bin/sh | |
- | |
-curl -s https://pleroma.fediverse.observer/app/views/tabledata.php?software=pl… | |
- | sed -e 's,app/views/podstat-user-counts.php?,\n,g' \ | |
- | grep "^domain=" \ | |
- | sed 's,^domain=\([^" ]*\).*,\1,' | |
- | |
+sed 's,",\\",g; s,$,\\n,' <<-EOF \ | |
+ | tr -d '\n' \ | |
+ | sed 's,^\(.*\)$,{"query":"\1"},' \ | |
+ | curl -s -H'Content-Type: application/json' --data-binary @- https://… | |
+ | jaq '$1 == ".data.nodes[].domain" { print $3 }' | |
+{ | |
+ nodes(softwarename: "pleroma", status: "UP") { | |
+ domain | |
+ } | |
+} | |
+EOF |