From 9231e51a387d18f30956125a20f3e216b974db6e Mon Sep 17 00:00:00 2001 From: gutmet Date: Tue, 21 Apr 2020 22:24:30 +0200 Subject: [PATCH] fakenews: script for creating a twitter digest --- fakenews | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100755 fakenews diff --git a/fakenews b/fakenews new file mode 100755 index 0000000..268cab0 --- /dev/null +++ b/fakenews @@ -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 'News' > $outfile + +while read account; do + echo "

$account

" >> $outfile + curl -H 'User-Agent:' -s "https://twitter.com/$account" | + tscrape | + awk -F '\t' '{$1 = strftime("%d-%m-%Y %H:%M:%S",$1); print "
" $6 "
" $4 " " $1 "
"}' | + sed 's/https:[^ ]*/&<\/a>/g' >> $outfile + echo "
" >> $outfile +done < "$accountsfile" + +echo '' >> $outfile +xdg-open $outfile