#!/bin/sh
archivebaseuri="gopher://bitreich.org/9/tgtimes/archive"
releases="$(find . -type d | tail -n +2 | cut -d'/' -f 2-)"
cat news.atom.head.xml
updated="$(date +%FT%T%z)"
printf "\t%s\n" "${updated}"
for release in $releases;
do
uri="${archivebaseuri}/${release}"
printf "\t\t\n"
printf "\t\t%s\n" "${uri}"
printf "\t\t\n" "${release}"
printf "\t\tThe Gopher Times Authors\n"
cd ${release}
txtedition=$(find . -type f -name "*.txt" | cut -d'/' -f 2-)
pdfedition=$(find . -type f -name "*.pdf" | cut -d'/' -f 2-)
printf "\t\t\n"
lastmodified=$(stat --printf="%Y" ${txtedition})
lastupdated="$(date +%FT%T%z -d @${lastmodified})"
printf "\t\t%s\n" "${lastupdated}"
mimetype="$(file --mime-type -b "${pdfedition}")"
printf "\t\t\n" \
"${mimetype}" \
"${uri}" \
"${pdfedition}"
cd ..
printf "\t\t\n"
done
cat news.atom.footer.xml