Last active
January 31, 2021 14:54
-
-
Save noellabo/02637a326829534f4a2965ab7227b422 to your computer and use it in GitHub Desktop.
Decentralized hongeipii counter
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [ ! -e hongeipii.txt ] | |
then | |
page=1 | |
next=`curl -H "Accept: application/activity+json" https://mstdn.beer/users/hongeipii/followers|jq -r '.first'` | |
while [ $next != 'null' ] | |
do | |
json=`curl -X GET -H "Accept: application/activity+json" -d "page=${page}" https://mstdn.beer/users/hongeipii/followers` | |
echo ${json}|jq -r '.orderedItems[]' >> hongeipii.txt | |
next=`echo ${json}|jq -r '.next'` | |
page=`expr $page + 1` | |
echo "page = ${page}" | |
done | |
fi | |
echo "hongeipii = `grep hongeipi hongeipii.txt -c`" | |
echo "" | |
echo "num server" | |
echo "-----------------" | |
grep hongeipii hongeipii.txt|sort|sed -E "s#^https://([^/]*)/.*#\1#"|uniq -c |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment