From 0df842c173198f62a7458c1350fca25f3b340209 Mon Sep 17 00:00:00 2001 From: qbi Date: Sun, 1 Jan 2023 23:55:18 +0100 Subject: [PATCH] Shellskript zur Ermittlung der Follower und Formatierung --- get_follower.sh | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 get_follower.sh diff --git a/get_follower.sh b/get_follower.sh new file mode 100644 index 0000000..54dc393 --- /dev/null +++ b/get_follower.sh @@ -0,0 +1,16 @@ +#!/usr/bin/env sh + +FLIST=Downloads/following-2023-01-01-10-41-58.csv +FURL="" +FFILE="$(date +%F)" +touch $FFILE + +# Preprocessing +#echo "qbi@mastodon.social\nmaxschrems@mastodon.social" >> $FLIST +sed -i.1 '/@a.gup.pe/d' $FLIST + +while read account; do + FURL=$(echo $account | sed 's,^\(.*\)@\(.*\),\2/users/\1/followers,') + NFOL=$(curl -Ls -H 'Accept: application/activity+json' $FURL | jq .totalItems) + echo "@$account ($NFOL)" >> $FFILE +done < $FLIST