From a9a076c06c2ff9add3e98451dadf8a50edfe6782 Mon Sep 17 00:00:00 2001 From: tastytea Date: Mon, 22 Feb 2021 00:02:37 +0100 Subject: [PATCH] instanceinfo.sh: Add support for Bookwyrm. --- instanceinfo.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/instanceinfo.sh b/instanceinfo.sh index 64b2a60..9e4a3d1 100755 --- a/instanceinfo.sh +++ b/instanceinfo.sh @@ -1,7 +1,7 @@ #!/bin/bash # Print some basic info about fediverse instances. -# Version: 2020-06-08_1 +# Version: 2021-02-22_1 if [[ -z "${1}" ]]; then echo "usage: ${0} DOMAIN" >&2 @@ -188,7 +188,9 @@ function main() if ${mycurl} -ILf -X POST "${misskeyinfo}" | grep -iq 'Content-Type: application/json'; then echo "Misskey API found." parse_misskey "${instance}" "${misskeyinfo}" - elif ${mycurl} -ILf "${nodeinfo}" | grep -iq 'Content-Type: application/json'; then + elif ${mycurl} -ILf "${nodeinfo}" | grep -iq 'Content-Type: application/json' \ + || ${mycurl} -s "${nodeinfo}" | jq -e '.software' > /dev/null; then + # ↑ Bookwyrm doesn't answer to HEAD requests ↑. echo "Nodeinfo found." parse_nodeinfo "${instance}" "${nodeinfo}" elif ${mycurl} -ILf "${mastoinfo}" | grep -iq 'Content-Type: application/json'; then