fakenews: limit number of tweets

This commit is contained in:
gutmet 2020-04-21 22:30:35 +02:00
parent 9231e51a38
commit 6cc2abf951

View File

@ -9,6 +9,7 @@
# keep one twitter account per line in here
accountsfile=".fakenews"
outfile="/tmp/fakenews_out.html"
numberOfTweets=5
echo '<html><head><title>News</title></head><body>' > $outfile
@ -16,6 +17,7 @@ while read account; do
echo "<h3>$account</h3><dl>" >> $outfile
curl -H 'User-Agent:' -s "https://twitter.com/$account" |
tscrape |
head -n $numberOfTweets |
awk -F '\t' '{$1 = strftime("%d-%m-%Y %H:%M:%S",$1); print "<dt>" $6 "</dt><dd>" $4 " <small>" $1 "</small></dd>"}' |
sed 's/https:[^ ]*/<a href="&">&<\/a>/g' >> $outfile
echo "</dl>" >> $outfile