From 05386f6040df98384f7e3abbb6b9f94832ee6a69 Mon Sep 17 00:00:00 2001 From: tastytea Date: Mon, 22 Jul 2019 00:12:31 +0200 Subject: [PATCH] instanceinfo.sh: Always select the newest nodeinfo-version. --- instanceinfo.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/instanceinfo.sh b/instanceinfo.sh index f956f32..5f93943 100755 --- a/instanceinfo.sh +++ b/instanceinfo.sh @@ -1,7 +1,7 @@ #!/bin/bash # Print some basic info about fediverse instances. -# Version: 2019-07-21_1 +# Version: 2019-07-22_1 if [[ -z "${1}" ]]; then echo "usage: ${0} DOMAIN" >&2 @@ -60,7 +60,7 @@ function parse_nodeinfo() # shellcheck disable=SC2155 local active=$(jq -r ".usage.users.activeMonth" <<<"${json}") - [[ "${active}" != "null" ]] && echo "Active user (month): ${active}" + [[ "${active}" != "null" ]] && echo "Active users (month): ${active}" echo -n "Open registrations: " jq -r ".openRegistrations" <<<"${json}" @@ -164,7 +164,7 @@ function main() { local instance="${1}" # shellcheck disable=SC2155 - local nodeinfo=$(${mycurl} -L "https://${instance}/.well-known/nodeinfo" | jq -r '.links[-1].href' 2> /dev/null) + local nodeinfo=$(${mycurl} -L "https://${instance}/.well-known/nodeinfo" | jq -r '.links[].href' | sort | tail -n 1 2> /dev/null) local mastoinfo="https://${instance}/api/v1/instance" local misskeyinfo="https://${instance}/api/meta"