Utilities for imasimgbot
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Make fetchfollowers.sh work anywhere

Engielolz a8582839 edd8cfed

+11 -1
+11 -1
fetchfollowers.sh
··· 1 1 #!/bin/bash 2 2 3 + workdir=/usr/local/bin/imasimgbot 4 + apiurl=https://public.api.bsky.app 5 + if [ -n "$1" ]; then 6 + if ! [ -z "$2" ]; then apiurl=$2; fi 7 + workdir=$1 8 + fi 9 + if [ ! -d "$workdir" ]; then echo "imasimgbot not found at $workdir. try passing its location as first parameter"; exit 1; fi 10 + pushd "$workdir" > /dev/null 11 + 3 12 function loadFail () { 4 13 echo "Required scripts not found!" 5 14 exit 127 ··· 12 21 bap_loadSecrets data/$1/secrets.env 13 22 savedAccess= 14 23 savedRefresh= 15 - followerscount=$(curl -s -G --data-urlencode "actor=$savedDID" "https://public.api.bsky.app/xrpc/app.bsky.actor.GetProfile" | jq -r .followersCount) 24 + followerscount=$(curl -s -G --data-urlencode "actor=$savedDID" "$apiurl/xrpc/app.bsky.actor.GetProfile" | jq -r .followersCount) 16 25 if [ -z "$followerscount" ]; then echo "$1: error obtaining follower count" 17 26 else echo "$1: $followerscount followers" 18 27 fi ··· 22 31 for i in $(seq 1 $(cat data/idols.txt | wc -l)); do 23 32 fetchFollowers $(cat data/idols.txt | sed -n $i'p') 24 33 done 34 + popd > /dev/null