commit: ff0ca5579d96693932a58a5edb33f429f0d97088
parent: 01d81014cbde7cd63bf28dea8e76a9b2f37df3fd
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date: Sun, 3 Mar 2019 03:36:58 +0100
webfinger.sh: New fediverse related program
Diffstat:
1 file changed, 17 insertions(+), 0 deletions(-)
diff --git a/bin/webfinger.sh b/bin/webfinger.sh
@@ -0,0 +1,17 @@
+#!/bin/sh
+acct="$1"
+accept_header='Accept: application/json,application/xml'
+
+die() {
+ echo $@
+ exit 1
+}
+
+if [[ -z "${acct}" ]]
+then
+ die "Usage: ${0} [webfinger acct]"
+fi
+
+host=$(cut -f2 -d'@' <<<"${acct}")
+
+curl -sSL -H "${accept_header}" "http://${host}/.well-known/webfinger?resource=acct:${acct}"