···11# imasimgbot-utils
22-Utilities for imasimgbot.
22+Utilities for imasimgbot that I use internally. Some of these might be useful if you run an imasimgbot instance yourself, others might not be.
3344## Contents
55### Server
66+These tools need to be run on the machine running imasimgbot itself
67* `fetchfollowers` - Loads the contents of idols.txt and prints follower counts for the idols in it
88+* `futamicount` - Counts image entries for the Futami Image Bot per twin (or both)
79### Standalone
1010+These tools can be run anywhere
811* `mkentry` - Easy utility to make image entries for imasimgbot
1212+* `posttime` - Calculates nextPostTime with a given postInterval
+19
futamicount.sh
···11+#!/bin/bash
22+event=regular
33+workdir=/usr/local/bin/imasimgbot
44+if [ -n "$1" ]; then workdir=$1; fi
55+if [ ! -d "$workdir" ]; then echo "imasimgbot not found at $workdir. try passing its location as first parameter"; exit 1; fi
66+pushd "$workdir" > /dev/null
77+amiCount=0 mamiCount=0 bothCount=0 unknownCount=0 unknownList=''
88+for j in $(seq 1 "$(wc -l <"data/futami/images/$event.txt")"); do
99+ image=$(sed -n "$j"'p' <"data/futami/images/$event.txt")
1010+ case "$image" in
1111+ ami.*) ((amiCount++));;
1212+ mami.*) ((mamiCount++));;
1313+ both.*) ((bothCount++));;
1414+ *) ((unknownCount++)); unknownList="$unknownList\n$image";;
1515+ esac
1616+done
1717+echo -e "Counted:\nAmi has $amiCount entries\nMami has $mamiCount entries\nBoth has $bothCount entries"
1818+if [ "$unknownCount" != "0" ]; then echo -e "Found $unknownCount entries that didn't match: $unknownList"; fi
1919+popd > /dev/null