tcount emojis and filters as separate columns - bitreich-memestats - metrics an… | |
git clone git://src.adamsgaard.dk/bitreich-memestats | |
Log | |
Files | |
Refs | |
LICENSE | |
--- | |
commit d96b23e68eb88aab698fd736780af4bf93c96e1d | |
parent 0eb1f8eff94f620eaf0d4733e39f1174202c19ca | |
Author: Anders Damsgaard <[email protected]> | |
Date: Mon, 25 Dec 2023 20:15:45 +0100 | |
count emojis and filters as separate columns | |
Diffstat: | |
M extract-memecount.sh | 11 ++++++++++- | |
1 file changed, 10 insertions(+), 1 deletion(-) | |
--- | |
diff --git a/extract-memecount.sh b/extract-memecount.sh | |
t@@ -9,11 +9,17 @@ fi | |
annnadir="${1}" | |
memefile="modules/hashtags/hashtags.txt" | |
+emojidir="/br/gopher/emoji/" | |
+filterdir="/br/gopher/memecache/filter/" | |
update_annna=yes | |
outputfile="${2:-memecount.log}" | |
revisionrange="" | |
datefmt="%Y-%m-%d" | |
+countolderfiles() { | |
+ find "$1" -maxdepth 1 -type f \! -newerct "$2" | wc -l | |
+} | |
+ | |
if [ ! -e "${annnadir}/${memefile}" ]; then | |
printf 'error: could not open %s\n' "${annnadir}/${memefile}" | |
exit 1 | |
t@@ -78,9 +84,12 @@ i=0 | |
n0="$n" | |
t0="$timestamp" | |
lastprintdate="$date" | |
+ n_emoji="$(countolderfiles "$emojidir" "$date")" | |
+ n_filter="$(countolderfiles "$filterdir" "$date")" | |
- printf '%s\t%s\t%s\t%s\t%s\n' \ | |
+ printf '%s\t%s\t%s\t%s\t%s\t%s\t%s\n' \ | |
"$date" "$commit" "$n" "$timestamp" "$dn_dt" \ | |
+ "$n_emoji" "$n_filter" \ | |
>> "${outputfile}" | |
fi |