💾 Archived View for tilde.team › ~smokey › extras › script_dailydigest.gmi captured on 2022-06-04 at 00:37:38. Gemini links have been rewritten to link to archived content
-=-=-=-=-=-=-
#!/usr/bin/bash # defining time variables TODAY=$(date +%Y-%m-%d) YESTERDAY=$(date -d yesterday +%Y-%m-%d) TWODAYS=$(date -d "2 days ago" +%Y-%m-%d) # feed sources ANTENNA="gemini://warmedal.se/~antenna/filter/SBGElEWlRYOQbVaKYElminMkCNyskFlc" COMITIUM="gemini://gemini.cyberbot.space/feed.gmi" NEWS="gemini://rawtext.club/~sloum/geminews/npr/" # making temporary text files for gcat to output data into echo making temporary text files... tmp_d=$(mktemp -d) tmpcomitium1="$tmp_d/comitium1.txt" tmpcomitium2="$tmp_d/comitium2.txt" tmpantenna1="$tmp_d/antenna1.txt" tmpantenna2="$tmp_d/antenna2.txt" tmpnews="$tmp_d/news.txt" echo finished! # remove the temp files after script finishes trap 'rm -rf -- "$tmp_d"' EXIT # making sure the dailydigest folder exist in the home directory echo generating and cleaning dailydigests folder... mkdir -p $HOME/dailydigests #deleting possible previous contents for a fresh directory. rm $HOME/dailydigests/* # comitium feed digest for today echo creating todays comitium epub... gcat $COMITIUM | tail -n +9 | awk -v today="## $TODAY" -v yesterday="## $YESTERDAY" '$0 ~ today {flag=1} $0 ~ yesterday {flag=0} flag {print $2}' | awk '/gemini/ {print}' | xargs -d