diff options
| author | Zach DeCook <zachdecook@librem.one> | 2022-01-01 10:09:29 -0500 |
|---|---|---|
| committer | Zach DeCook <zachdecook@librem.one> | 2022-01-01 10:09:29 -0500 |
| commit | d8375da4c81a46357783a55955b802cd8ae0ad11 (patch) | |
| tree | 4c536abe8c659a22db4578773c44589bf35b9d1e /aoyb.sh | |
| parent | 5060e4a19af7f38ffc998c3afd1ac1d76dcaa6ce (diff) | |
| download | cgi-bin-d8375da4c81a46357783a55955b802cd8ae0ad11.tar.gz | |
audio oneyearbible: write wrapper
Diffstat (limited to 'aoyb.sh')
| -rwxr-xr-x | aoyb.sh | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/aoyb.sh b/aoyb.sh new file mode 100755 index 0000000..ac00698 --- /dev/null +++ b/aoyb.sh @@ -0,0 +1,15 @@ +#!/bin/sh +case "$PATH_INFO" in +"") + printf '20 text/gemini\r\n' + curl https://audio.oneyearbible.com/ | grep mp3 |sed 's/href="/\t/g' |cut -f2 |cut -d '"' -f1 | sed 's/^/=>/g' + ;; +*.mp3) + printf "20 audio/mpeg\r\n" + curl --output - "https://audio.oneyearbible.com/$PATH_INFO" + ;; +*) + printf '20 text/gemini\r\n' + printf '=> https://audio.oneyearbible.com/%s' "$PATH_INFO" + ;; +esac |
