From ee8189d476e428188516f8d6f6a58707a62195b3 Mon Sep 17 00:00:00 2001 From: Samuel Sloniker Date: Thu, 24 Nov 2022 19:48:54 -0800 Subject: [PATCH] Update stats script --- stats.sh | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/stats.sh b/stats.sh index 8cbe0ce..61d1b6e 100755 --- a/stats.sh +++ b/stats.sh @@ -7,7 +7,11 @@ right=$(sqlite3 articles.db "SELECT url FROM articles WHERE category = 'right'" left_sources=$(sqlite3 articles.db "SELECT source FROM articles WHERE category = 'left'" | sort | uniq) right_sources=$(sqlite3 articles.db "SELECT source FROM articles WHERE category = 'right'" | sort | uniq) -echo "This model contains a total of $total articles ($left left, $right right)." +total_source_count=$(sqlite3 articles.db "SELECT source FROM articles" | sort | uniq | wc -l) +left_source_count=$(echo $left_sources | wc -w) +right_source_count=$(echo $right_sources | wc -w) + +echo "This model contains a total of $total articles from $total_source_count sources." echo "" echo "## Left" echo "" @@ -15,8 +19,12 @@ for i in $left_sources; do echo "* $i: $(sqlite3 articles.db "SELECT url FROM articles WHERE source = '$i'" | wc -l)" done echo "" +echo "Left total: $left articles from $left_source_count sources" +echo "" echo "## Right" echo "" for i in $right_sources; do echo "* $i: $(sqlite3 articles.db "SELECT url FROM articles WHERE source = '$i'" | wc -l)" done +echo "" +echo "Right total: $right articles from $right_source_count sources"