1
0
mirror of https://github.com/kmein/niveum synced 2026-03-16 10:11:08 +01:00
Files
niveum/packages/odyssey.nix

12 lines
418 B
Nix
Raw Permalink Normal View History

2019-05-14 07:18:04 +02:00
{ xmlstarlet, curl, writeShellScriptBin }:
writeShellScriptBin "odyssey" ''
if [ $# -eq 1 ] && (echo "$1" | grep -Eq '[0-9]+\.[0-9]+'); then
${curl}/bin/curl -Gs http://www.perseus.tufts.edu/hopper/CTS \
-d request=GetPassage \
-d "urn=urn:cts:greekLit:tlg0012.tlg002:$1" \
| ${xmlstarlet}/bin/xmlstarlet sel -t -v 'cts:GetPassage//tei:div'
else
echo you must supply BOOK.VERSE
fi
''