~earboxer/cgi-bin

dad94fb935bb9f1ee4f03357c45ecab4191389f1 — Zach DeCook 4 months ago 447a2ef
Site-parsing scripts: Update to use wget
5 files changed, 8 insertions(+), 8 deletions(-)

M ccel.sh -rwxr-xr-x => -rw-r--r--
M ccelauthor.sh -rwxr-xr-x => -rw-r--r--
M ccelindex.sh -rwxr-xr-x => -rw-r--r--
M gcc.sh
M usfm2gmi
M ccel.sh => ccel.sh +0 -0
M ccelauthor.sh => ccelauthor.sh +0 -0
M ccelindex.sh => ccelindex.sh +0 -0
M gcc.sh => gcc.sh +7 -7
@@ 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' \

M usfm2gmi => usfm2gmi +1 -1
@@ 1,1 1,1 @@
Subproject commit 21a75c18879896bd5380b37551bf28f473f6105a
Subproject commit 3679315e6fd1ba1c02a002ce208f385f5989b281