fakenews: limit number of tweets
This commit is contained in:
parent
9231e51a38
commit
6cc2abf951
2
fakenews
2
fakenews
|
@ -9,6 +9,7 @@
|
||||||
# keep one twitter account per line in here
|
# keep one twitter account per line in here
|
||||||
accountsfile=".fakenews"
|
accountsfile=".fakenews"
|
||||||
outfile="/tmp/fakenews_out.html"
|
outfile="/tmp/fakenews_out.html"
|
||||||
|
numberOfTweets=5
|
||||||
|
|
||||||
echo '<html><head><title>News</title></head><body>' > $outfile
|
echo '<html><head><title>News</title></head><body>' > $outfile
|
||||||
|
|
||||||
|
@ -16,6 +17,7 @@ while read account; do
|
||||||
echo "<h3>$account</h3><dl>" >> $outfile
|
echo "<h3>$account</h3><dl>" >> $outfile
|
||||||
curl -H 'User-Agent:' -s "https://twitter.com/$account" |
|
curl -H 'User-Agent:' -s "https://twitter.com/$account" |
|
||||||
tscrape |
|
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>"}' |
|
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
|
sed 's/https:[^ ]*/<a href="&">&<\/a>/g' >> $outfile
|
||||||
echo "</dl>" >> $outfile
|
echo "</dl>" >> $outfile
|
||||||
|
|
Loading…
Reference in New Issue
Block a user