Added Funkwhale support.

This commit is contained in:
tastytea 2019-06-25 02:19:15 +02:00
parent 4f718646c6
commit 778c86d52c
Signed by: tastytea
GPG Key ID: CFC39497F1B26E07
1 changed files with 10 additions and 2 deletions

View File

@ -1,7 +1,7 @@
#!/bin/bash
# Print some basic info about fediverse instances.
# Version: 2019-06-24_7
# Version: 2019-06-25_1
if [[ -z "${1}" ]]; then
echo "usage: ${0} DOMAIN" >&2
@ -43,7 +43,7 @@ function main()
# # shellcheck disable=SC2155
# local federation=$(curl -s -X POST "https://${instance}/api/federation/instances" | jq ".[].host")
# # shellcheck disable=SC2046
# [[ -n ${federation} ]] && echo -n "Federates with: " && echo "${federation}"
# [[ -n ${federation} ]] && echo "Federates with: ${federation}"
# shellcheck disable=SC2155
local tos=$(jq -r ".ToSUrl" <<<"${json}")
@ -58,6 +58,9 @@ function main()
# shellcheck disable=SC2155
local description=$(jq -r ".metadata.nodeDescription" <<<"${json}")
if [[ "${description}" == "null" ]]; then
description=$(jq -r ".metadata.shortDescription" <<<"${json}")
fi
if [[ "${description}" == "null" ]]; then
description=$(jq -r ".metadata.nodeName" <<<"${json}")
fi
@ -76,6 +79,11 @@ function main()
if [[ "${implementation}" == "pleroma" ]]; then
echo "Further info, maybe: https://${instance}/about"
elif [[ "${implementation}" == "funkwhale" ]]; then
echo -n "Artists / tracks: "
jq -rj ".metadata.library.artists.total" <<<"${json}"
echo -n " / "
jq -r ".metadata.library.tracks.total" <<<"${json}"
fi
elif curl -sIf "${mastoinfo}" | grep -iq 'Content-Type: application/json'; then
echo "Mastodon API found."