scripts for my gemini capsule
get newplan.tsv
Zach DeCook 3 weeks ago
parent c07d7af · commit 3214979
-rw-r--r--.gitignore1
-rw-r--r--getplan.sh5
-rw-r--r--makeplan.sh13
3 files changed, 13 insertions, 6 deletions
diff --git a/.gitignore b/.gitignore
index 522e80c..c7a6592 100644
--- a/.gitignore
+++ b/.gitignore
@@ -5,3 +5,4 @@ bsb
tcgnt
hboWLC
gcc.cache/*
+newplan.tsv
diff --git a/getplan.sh b/getplan.sh
new file mode 100644
index 0000000..41bbd5f
--- /dev/null
+++ b/getplan.sh
@@ -0,0 +1,5 @@
+#!/bin/sh
+doas apk add cmd:pdf2txt.py
+wget -o - https://v1.whc.life/assets/site/pdf/YearBiblePlan.pdf
+pdf2txt.py YearBiblePlan.pdf | sed 's/\(Jan\|Feb\|Mar\|Apr\|May\|June\|July\|Aug\|Sept\|Octo\|Nov\|Dec\)/#\1/g' | uniq |tr '\n' '\t' | tr '#' '\n' |sed 's/ *\t\t\+/\t/g' | sed 's/–/-/g' >newplan.tsv
+rm YearBiblePlan.pdf
diff --git a/makeplan.sh b/makeplan.sh
index 71d1acb..8a0637d 100644
--- a/makeplan.sh
+++ b/makeplan.sh
@@ -1,11 +1,12 @@
#!/bin/sh
-day=$(date +%j)
-echo "# Day $day/365"
+day=$(date +'%j')
+day_human=$(date +'%B %d')
+echo "# Reading for $day_human"
-ot="$(grep "^$day" "$1" | cut -f2)"
-nt="$(grep "^$day" "$1" | cut -f3)"
-ps="$(grep "^$day" "$1" | cut -f4)"
-pr="$(grep "^$day" "$1" | cut -f5)"
+nt="$(grep "^$day_human" "$1" | cut -f3)"
+ot="$(grep "^$day_human" "$1" | cut -f2)"
+ps="$(grep "^$day_human" "$1" | cut -f4)"
+pr="$(grep "^$day_human" "$1" | cut -f5)"
if [ -e /srv/gemini/gemini.zachdecook.com/oyb/$day.mp3 ]; then
echo "=> /oyb/$day.mp3 Listen to today's reading by Zach!"