scripts for my gemini capsule
Site-parsing scripts: Update to use wget
Zach DeCook 2023-10-07
parent 447a2ef · commit dad94fb
-rw-r--r--[-rwxr-xr-x]ccel.sh0
-rw-r--r--[-rwxr-xr-x]ccelauthor.sh0
-rw-r--r--[-rwxr-xr-x]ccelindex.sh0
-rwxr-xr-xgcc.sh14
m---------usfm2gmi0
5 files changed, 7 insertions, 7 deletions
diff --git a/ccel.sh b/ccel.sh
index 0670fa3..0670fa3 100755..100644
--- a/ccel.sh
+++ b/ccel.sh
diff --git a/ccelauthor.sh b/ccelauthor.sh
index a383b68..a383b68 100755..100644
--- a/ccelauthor.sh
+++ b/ccelauthor.sh
diff --git a/ccelindex.sh b/ccelindex.sh
index 3e30d08..3e30d08 100755..100644
--- a/ccelindex.sh
+++ b/ccelindex.sh
diff --git a/gcc.sh b/gcc.sh
index 6d55641..024745a 100755
--- a/gcc.sh
+++ b/gcc.sh
@@ -3,7 +3,7 @@
if [ "$PATH_INFO" = "" ]
then
printf "20 text/gemini\r\n"
- curl -s https://gccsatx.com/hymns/ | grep ' <a href="https://gccsatx.com/hymns/' | cut -d/ -f5 | sed 's@^@=>gcc.sh/@g'
+ wget -q -O - https://gccsatx.com/hymns/ | grep -o 'https://gccsatx.com/hymns/[^/"#]\+/' |cut -d/ -f5 | sed 's@^@=>gcc.sh/@g'
exit 0
fi
@@ -11,18 +11,18 @@ hasmp3=$(echo "$QUERY_STRING"|grep 'mp3')
if [ ! "$hasmp3" = "" ]
then
printf "20 audio/mpeg\r\n"
- mp3=$(curl -s https://gccsatx.com/hymns$PATH_INFO/ | grep \.mp3 | sed 's/ /\n/g' | grep \.mp3 | grep href | cut -d'"' -f2)
- curl --output - $mp3
+ mp3=$(wget -q -O - https://gccsatx.com/hymns$PATH_INFO/ | grep \.mp3 | sed 's/ /\n/g' | grep \.mp3 | grep href | cut -d'"' -f2)
+ wget -O - $mp3
exit 0
fi
printf "20 text/gemini\r\n"
printf "=>/cgi-bin/gcc.sh$PATH_INFO?.mp3 Listen to this!\n"
-curl -s https://gccsatx.com/hymns$PATH_INFO/ \
+wget -q -O - https://gccsatx.com/hymns$PATH_INFO/ \
+| grep -o '\(<strong>\|<p>\|\)[^<>]*\(</strong>\|</p>\|<br />\)' \
+| sed 's@<br />@@g'| sed 's@^<strong>@\n## @g' | sed 's@</strong>@@g' | sed 's@</p>@@g' | sed 's@<p>@@g' \
| sed 's@ <title>@#@g' | sed 's@ | Hymn Lyrics and Piano Music</title>@@g'\
-| sed 's@<p><strong>@##@g' | sed 's@</strong>@@g'\
-| sed 's@<p>@@g' \
-| sed 's@<br />@@g' | sed 's@</p>@@' | grep -v '<' \
+| grep -v '<' \
| grep -v '!important' | grep -v '}\|{\|wp-smiley' \
| sed 's/&#8216;/‘/g' |sed 's/&#8217;/’/g' | sed 's/&#8221;/”/g' | sed 's/&#8220;/“/g'\
| grep -v 'this website' \
diff --git a/usfm2gmi b/usfm2gmi
-Subproject 21a75c18879896bd5380b37551bf28f473f6105
+Subproject 3679315e6fd1ba1c02a002ce208f385f5989b28