scripts for my gemini capsule
Site-parsing scripts: Update to use wget
| -rw-r--r--[-rwxr-xr-x] | ccel.sh | 0 | ||||
| -rw-r--r--[-rwxr-xr-x] | ccelauthor.sh | 0 | ||||
| -rw-r--r--[-rwxr-xr-x] | ccelindex.sh | 0 | ||||
| -rwxr-xr-x | gcc.sh | 14 | ||||
| m--------- | usfm2gmi | 0 |
5 files changed, 7 insertions, 7 deletions
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 @@ -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/‘/‘/g' |sed 's/’/’/g' | sed 's/”/”/g' | sed 's/“/“/g'\ | grep -v 'this website' \ diff --git a/usfm2gmi b/usfm2gmi -Subproject 21a75c18879896bd5380b37551bf28f473f6105 +Subproject 3679315e6fd1ba1c02a002ce208f385f5989b28 |