diff --git a/instanceinfo.sh b/instanceinfo.sh index 791772a..749d54a 100755 --- a/instanceinfo.sh +++ b/instanceinfo.sh @@ -1,7 +1,7 @@ #!/bin/bash # Print some basic info about fediverse instances. -# Version: 2019-07-15_2 +# Version: 2019-07-16_1 if [[ -z "${1}" ]]; then echo "usage: ${0} DOMAIN" >&2 @@ -79,6 +79,10 @@ function main() echo -n "Number of users: " jq -r ".usage.users.total" <<<"${json}" + # shellcheck disable=SC2155 + local active=$(jq -r ".usage.users.activeMonth" <<<"${json}") + [[ "${active}" != "null" ]] && echo "Active user (month): ${active}" + echo -n "Open registrations: " jq -r ".openRegistrations" <<<"${json}" @@ -95,6 +99,8 @@ function main() jq -r ".metadata.library.tracks.total" <<<"${json}" elif [[ "${implementation}" == "mastodon" ]]; then echo "Further info, maybe: https://${instance}/about/more" + elif [[ "${implementation}" == "pixelfed" ]]; then + echo "Further info, maybe: https://${instance}/site/terms" fi elif curl -sILf "${mastoinfo}" | grep -iq 'Content-Type: application/json'; then echo "Mastodon API found."