fakenews: script for creating a twitter digest
This commit is contained in:
parent
5bc42e2b6c
commit
9231e51a38
25
fakenews
Executable file
25
fakenews
Executable file
|
@ -0,0 +1,25 @@
|
|||
#!/bin/bash
|
||||
|
||||
#########################################################
|
||||
# fakenews ##
|
||||
# create an html digest of watched twitter accounts ##
|
||||
# with https://codemadness.org/git/tscrape/ and gawk ##
|
||||
#########################################################
|
||||
|
||||
# keep one twitter account per line in here
|
||||
accountsfile=".fakenews"
|
||||
outfile="/tmp/fakenews_out.html"
|
||||
|
||||
echo '<html><head><title>News</title></head><body>' > $outfile
|
||||
|
||||
while read account; do
|
||||
echo "<h3>$account</h3><dl>" >> $outfile
|
||||
curl -H 'User-Agent:' -s "https://twitter.com/$account" |
|
||||
tscrape |
|
||||
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
|
||||
done < "$accountsfile"
|
||||
|
||||
echo '</body></html>' >> $outfile
|
||||
xdg-open $outfile
|
Loading…
Reference in New Issue
Block a user