mime.sh 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. #!/bin/sh
  2. cd "$(dirname "$0")" || exit 1
  3. # readonly acc="--header 'Accept: application/xrd+xml'"
  4. # readonly acc="--header 'Accept: application/jrd+json'"
  5. while read -r wefi typ pro
  6. do
  7. echo "$typ $wefi"
  8. local_part="$(echo "$wefi" | cut -d @ -f 2)"
  9. host="$(echo "$wefi" | cut -d @ -f 3)"
  10. curl \
  11. --dump-header h \
  12. --header "Accept: application/jrd+json" \
  13. --location \
  14. --max-time 5.0 \
  15. --silent \
  16. "https://$host/.well-known/webfinger?resource=acct:${local_part}@${host}" \
  17. > /dev/null
  18. echo " Webfinger $(grep -Ei "^content-type:" h)"
  19. curl \
  20. --dump-header h \
  21. --header "Accept: application/xrd+xml" \
  22. --location \
  23. --max-time 5.0 \
  24. --silent \
  25. "https://$host/.well-known/host-meta" \
  26. > /dev/null
  27. echo " host-meta $(grep -Ei "^content-type:" h)"
  28. curl \
  29. --dump-header h \
  30. --header "Accept: application/jrd+json" \
  31. --location \
  32. --max-time 5.0 \
  33. --silent \
  34. "https://$host/.well-known/nodeinfo" \
  35. > /dev/null
  36. echo " nodeinfo $(grep -Ei "^content-type:" h)"
  37. curl \
  38. --dump-header h \
  39. --header "Accept: application/activity+json" \
  40. --location \
  41. --max-time 5.0 \
  42. --silent \
  43. "$pro" \
  44. > /dev/null
  45. echo " Profile $(grep -Ei "^content-type:" h)"
  46. # exit 0
  47. echo ""
  48. done <<-EOF
  49. @administrator@gnusocial.net GnuSocial https://gnusocial.net/index.php/user/1
  50. @alfred@libranet.de Friendica https://libranet.de/profile/alfred
  51. @boyter@honk.boyter.org Honk https://honk.boyter.org/u/boyter
  52. @dev@microblog.pub Micro.blog https://microblog.pub
  53. @edps@tube.network.europa.eu Peertube https://tube.network.europa.eu/accounts/edps
  54. @grunfink@comam.es snac https://comam.es/snac/grunfink
  55. @mike@macgirvin.com Hubzilla https://macgirvin.com/channel/mike
  56. @mro_seppo@mastodon.social Mastodon https://mastodon.social/users/mro_seppo
  57. @mro@firefish.social Firefish https://firefish.social/users/9j2ot3jvzun7u3hi
  58. @mro@fosstodon.org Mastodon https://fosstodon.social/users/mro
  59. @mro@lemmy.world Lemmy https://lemmy.world/u/mro
  60. @mro@misskey.social Misskey https://misskey.social/users/9j2hlahlgi
  61. @mro@outerheaven.club Akkoma https://outerheaven.club/users/mro
  62. @mro@pixelfed.social Pixelfed https://pixelfed.social/users/mro
  63. @takahe@jointakahe.org Takahe https://jointakahe.takahe.social/@takahe@jointakahe.org/
  64. @grindhold@demoday.leadfathom.grindhold.de Flohmarkt https://demoday.leadfathom.grindhold.de/users/grindhold
  65. @2023-08-28@dev.seppo.social Seppo https://dev.seppo.social/2023-08-28/activitypub/profile.jlda
  66. EOF