2022-11-24 09:43:04 -08:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
total=$(sqlite3 articles.db "SELECT url FROM articles" | wc -l)
|
|
|
|
left=$(sqlite3 articles.db "SELECT url FROM articles WHERE category = 'left'" | wc -l)
|
|
|
|
right=$(sqlite3 articles.db "SELECT url FROM articles WHERE category = 'right'" | wc -l)
|
|
|
|
|
|
|
|
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)
|
|
|
|
|
2022-11-24 19:48:54 -08:00
|
|
|
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."
|
2022-11-24 09:43:04 -08:00
|
|
|
echo ""
|
|
|
|
echo "## Left"
|
|
|
|
echo ""
|
|
|
|
for i in $left_sources; do
|
|
|
|
echo "* $i: $(sqlite3 articles.db "SELECT url FROM articles WHERE source = '$i'" | wc -l)"
|
|
|
|
done
|
|
|
|
echo ""
|
2022-11-24 19:48:54 -08:00
|
|
|
echo "Left total: $left articles from $left_source_count sources"
|
|
|
|
echo ""
|
2022-11-24 09:43:04 -08:00
|
|
|
echo "## Right"
|
|
|
|
echo ""
|
|
|
|
for i in $right_sources; do
|
|
|
|
echo "* $i: $(sqlite3 articles.db "SELECT url FROM articles WHERE source = '$i'" | wc -l)"
|
|
|
|
done
|
2022-11-24 19:48:54 -08:00
|
|
|
echo ""
|
|
|
|
echo "Right total: $right articles from $right_source_count sources"
|