TeamDatenschutz/get_follower.sh

17 lines
471 B
Bash

#!/usr/bin/env sh
FLIST=accounts/following.csv
FURL=""
FFILE="$(date +%F)"
touch follower/$FFILE
# Preprocessing
echo "qbi@mastodon.social\nmaxschrems@mastodon.social\nCptIgor@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)" >> follower/$FFILE
done < $FLIST