Skip to content

Instantly share code, notes, and snippets.

@hakamadare
Created November 30, 2022 20:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hakamadare/3ec36e8a643f8661567c7929bc872c6d to your computer and use it in GitHub Desktop.
Save hakamadare/3ec36e8a643f8661567c7929bc872c6d to your computer and use it in GitHub Desktop.
using WebFinger to look up Mastodon users
# this is me looking up ef4
$ curl -s https://better.boston/.well-known/webfinger?resource=acct:ef4@better.boston | jq .
{
"subject": "acct:ef4@better.boston",
"aliases": [
"https://better.boston/@ef4",
"https://better.boston/users/ef4"
],
"links": [
{
"rel": "http://webfinger.net/rel/profile-page",
"type": "text/html",
"href": "https://better.boston/@ef4"
},
{
"rel": "self",
"type": "application/activity+json",
"href": "https://better.boston/users/ef4"
},
{
"rel": "http://ostatus.org/schema/1.0/subscribe",
"template": "https://better.boston/authorize_interaction?uri={uri}"
}
]
}
# and then looking up @crystalvisits
$ curl -s https://wrong.tools/.well-known/webfinger?resource=acct:crystalvisits@wrong.tools | jq .
{
"subject": "acct:crystalvisits@wrong.tools",
"aliases": [
"https://mas.wrong.tools/@crystalvisits",
"https://mas.wrong.tools/users/crystalvisits"
],
"links": [
{
"rel": "http://webfinger.net/rel/profile-page",
"type": "text/html",
"href": "https://mas.wrong.tools/@crystalvisits"
},
{
"rel": "self",
"type": "application/activity+json",
"href": "https://mas.wrong.tools/users/crystalvisits"
},
{
"rel": "http://ostatus.org/schema/1.0/subscribe",
"template": "https://mas.wrong.tools/authorize_interaction?uri={uri}"
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment