instanceinfo.sh: Always select the newest nodeinfo-version.
This commit is contained in:
parent
83b9c98135
commit
05386f6040
|
@ -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-21_1
|
# Version: 2019-07-22_1
|
||||||
|
|
||||||
if [[ -z "${1}" ]]; then
|
if [[ -z "${1}" ]]; then
|
||||||
echo "usage: ${0} DOMAIN" >&2
|
echo "usage: ${0} DOMAIN" >&2
|
||||||
|
@ -60,7 +60,7 @@ function parse_nodeinfo()
|
||||||
|
|
||||||
# shellcheck disable=SC2155
|
# shellcheck disable=SC2155
|
||||||
local active=$(jq -r ".usage.users.activeMonth" <<<"${json}")
|
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: "
|
echo -n "Open registrations: "
|
||||||
jq -r ".openRegistrations" <<<"${json}"
|
jq -r ".openRegistrations" <<<"${json}"
|
||||||
|
@ -164,7 +164,7 @@ function main()
|
||||||
{
|
{
|
||||||
local instance="${1}"
|
local instance="${1}"
|
||||||
# shellcheck disable=SC2155
|
# 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 mastoinfo="https://${instance}/api/v1/instance"
|
||||||
local misskeyinfo="https://${instance}/api/meta"
|
local misskeyinfo="https://${instance}/api/meta"
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue