instanceinfo.sh: Improved pixelfed support.
This commit is contained in:
parent
a3051b1c19
commit
29f9af8e66
|
@ -1,7 +1,7 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
# Print some basic info about fediverse instances.
|
# Print some basic info about fediverse instances.
|
||||||
|
|
||||||
# Version: 2019-07-15_2
|
# Version: 2019-07-16_1
|
||||||
|
|
||||||
if [[ -z "${1}" ]]; then
|
if [[ -z "${1}" ]]; then
|
||||||
echo "usage: ${0} DOMAIN" >&2
|
echo "usage: ${0} DOMAIN" >&2
|
||||||
|
@ -79,6 +79,10 @@ function main()
|
||||||
echo -n "Number of users: "
|
echo -n "Number of users: "
|
||||||
jq -r ".usage.users.total" <<<"${json}"
|
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: "
|
echo -n "Open registrations: "
|
||||||
jq -r ".openRegistrations" <<<"${json}"
|
jq -r ".openRegistrations" <<<"${json}"
|
||||||
|
|
||||||
|
@ -95,6 +99,8 @@ function main()
|
||||||
jq -r ".metadata.library.tracks.total" <<<"${json}"
|
jq -r ".metadata.library.tracks.total" <<<"${json}"
|
||||||
elif [[ "${implementation}" == "mastodon" ]]; then
|
elif [[ "${implementation}" == "mastodon" ]]; then
|
||||||
echo "Further info, maybe: https://${instance}/about/more"
|
echo "Further info, maybe: https://${instance}/about/more"
|
||||||
|
elif [[ "${implementation}" == "pixelfed" ]]; then
|
||||||
|
echo "Further info, maybe: https://${instance}/site/terms"
|
||||||
fi
|
fi
|
||||||
elif curl -sILf "${mastoinfo}" | grep -iq 'Content-Type: application/json'; then
|
elif curl -sILf "${mastoinfo}" | grep -iq 'Content-Type: application/json'; then
|
||||||
echo "Mastodon API found."
|
echo "Mastodon API found."
|
||||||
|
|
Loading…
Reference in New Issue