Browse Source

Finding outdated Mastodon instances

master
JustAnotherArchivist 5 years ago
parent
commit
c30dcf5985
1 changed files with 3 additions and 0 deletions
  1. +3
    -0
      mastodon-outdated

+ 3
- 0
mastodon-outdated View File

@@ -0,0 +1,3 @@
#!/bin/bash
beforeversion="$1"
curl -s 'https://instances.social/list.json?q%5Busers%5D=&strict=true' | python3 -c 'import json,sys'$'\n''d = json.loads(sys.stdin.read())'$'\n''for i in d["instances"]:'$'\n'' print("{} {} {} {}".format(i["name"], i["version"] or "None", i["users"], i["statuses"]))' | grep -v ' None ' | sort -k2,2 | awk '$2 < "'"${beforeversion}"'"' | awk '{print $1 " | data-sort-value=\"" $1 "\" | [http://" $1 "/ " $1 "] || " $2 " || " $3 " || " $4 }' | while read -r domain line; do content="$(curl -sL "http://${domain}/about")"; if grep -qF '//github.com/tootsuite/mastodon' <<<"${content}"; then mastodon="{{green|Yes}}"; elif grep -qF 'mastodon' <<<"${content}"; then mastodon="{{orange|Possibly}}"; else mastodon="{{red|No?}}"; fi; echo "${line} || ${mastodon}"; echo '|-'; done

Loading…
Cancel
Save