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