Utilities for imasimgbot
1
fork

Configure Feed

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

Add Futamicount and update README.md

Engielolz c3ae5616 46b6f222

+24 -1
+5 -1
README.md
··· 1 1 # imasimgbot-utils 2 - Utilities for imasimgbot. 2 + Utilities for imasimgbot that I use internally. Some of these might be useful if you run an imasimgbot instance yourself, others might not be. 3 3 4 4 ## Contents 5 5 ### Server 6 + These tools need to be run on the machine running imasimgbot itself 6 7 * `fetchfollowers` - Loads the contents of idols.txt and prints follower counts for the idols in it 8 + * `futamicount` - Counts image entries for the Futami Image Bot per twin (or both) 7 9 ### Standalone 10 + These tools can be run anywhere 8 11 * `mkentry` - Easy utility to make image entries for imasimgbot 12 + * `posttime` - Calculates nextPostTime with a given postInterval
+19
futamicount.sh
··· 1 + #!/bin/bash 2 + event=regular 3 + workdir=/usr/local/bin/imasimgbot 4 + if [ -n "$1" ]; then workdir=$1; fi 5 + if [ ! -d "$workdir" ]; then echo "imasimgbot not found at $workdir. try passing its location as first parameter"; exit 1; fi 6 + pushd "$workdir" > /dev/null 7 + amiCount=0 mamiCount=0 bothCount=0 unknownCount=0 unknownList='' 8 + for j in $(seq 1 "$(wc -l <"data/futami/images/$event.txt")"); do 9 + image=$(sed -n "$j"'p' <"data/futami/images/$event.txt") 10 + case "$image" in 11 + ami.*) ((amiCount++));; 12 + mami.*) ((mamiCount++));; 13 + both.*) ((bothCount++));; 14 + *) ((unknownCount++)); unknownList="$unknownList\n$image";; 15 + esac 16 + done 17 + echo -e "Counted:\nAmi has $amiCount entries\nMami has $mamiCount entries\nBoth has $bothCount entries" 18 + if [ "$unknownCount" != "0" ]; then echo -e "Found $unknownCount entries that didn't match: $unknownList"; fi 19 + popd > /dev/null