latinpoemget.sh (438B)
1 #!/bin/sh 2 # To TSV-ify webpages from https://www.thelatinlibrary.com/ 3 author="vergil" 4 title="ec" 5 max=10 6 b=2 7 8 for n in $(seq $max); do 9 curl -L "https://www.thelatinlibrary.com/$author/$title$n.shtml" | sed -n '/<p class="internal_navigation"/,/<div class="footer"/{/^\w/p}' | sed 's/<BR>/\n/' | sed -e 's/ .*//' -e 's/<.*>//g' -e '/^\s*$/d' | awk "{printf(\"Eclogues\tEcl\t${b}\t${n}\t%d\t%s\n\", NR, \$0)}" 10 done >> latinpoem.tsv