X-Git-Url: https://fleuret.org/cgi-bin/gitweb/gitweb.cgi?a=blobdiff_plain;f=dhtml.sh;h=cefb84351192fd47c4d00dae80b44d6f01bc44e4;hb=ff3c51b5ab68a4f719e2eed9a32422ebbd56d857;hp=8b74fe2eda2a12c2037a4111b971fbd07aafd4d0;hpb=687d1df9e0b0a6ccfb89578084012ddb8c5efc52;p=scripts.git diff --git a/dhtml.sh b/dhtml.sh index 8b74fe2..cefb843 100755 --- a/dhtml.sh +++ b/dhtml.sh @@ -69,6 +69,14 @@ do line=$(sed -e "s/@SIZE{\([^}]*\)}/${filesize_h}/" <<<"${line}") done + while [[ ${line} =~ @URLDATE ]] + do + filename=$(sed -e "s/^.*@URLDATE{\([^}]*\)}.*$/\1/" <<<"${line}") + timestamp=$(curl -Lv "${filename}" 2>&1 | \grep '^< Last-Modified:' | sed -e 's/^.*Last-Modified: *//') + timestamp=$(date -d "${timestamp}" +'%b %e, %Y') + line=$(sed -e "s/@URLDATE{\([^}]*\)}/${timestamp}/" <<<"${line}") + done + while [[ ${line} =~ @FILEDATE ]] do filename=$(sed -e "s/^.*@FILEDATE{\([^}]*\)}.*$/\1/" <<<"${line}")