#!/bin/sh
count=0
# html header
header()
{
printf '%s' "
videographed
videographed
"
}
#html footer
footer()
{
printf '\t\t%s' "
"
}
# for every line of input
# check if it contains "Link/mp3"
# if it does, output it
exclude()
{
while read -r line
do
case "$line" in
*Link/vid* )
printf '%s\n' "$line"
;;
esac
done
}
# for every line of input
# strip "path": " from the start
# string ", from the end
strip()
{
while read -r line
do
nameandtail="${line##\"path\": \"Link/}"
name="${nameandtail%%.txt\",}"
printf '%s\n' "$name" | sed "s/SLASH/\//g"
done
}
# for every line of input
# append root to the start
# format path and name as href
pad()
{
while read -r line
do
link=https://"${line##*--}"
date=${line##vid--}
date=${date%%--*}
year=${date%%-*}
month=${date#*-}
month=${month%%-*}
day=${date##*-}
if [ $month -eq 1 ]
then
humonth=january
elif [ $month -eq 2 ]
then
humonth=february
elif [ $month -eq 3 ]
then
humonth=march
elif [ $month -eq 4 ]
then
humonth=april
elif [ $month -eq 5 ]
then
humonth=may
elif [ $month -eq 6 ]
then
humonth=june
elif [ $month -eq 7 ]
then
humonth=july
elif [ $month -eq 8 ]
then
humonth=august
elif [ $month -eq 9 ]
then
humonth=september
elif [ $month -eq 10 ]
then
humonth=october
elif [ $month -eq 11 ]
then
humonth=november
elif [ $month -eq 12 ]
then
humonth=december
else
humonth=secret
fi
if [ $day -lt 10 ]
then
huday=${day#0}
else
huday=$day
fi
if [ "$olddate" != "$date" ] || [ $count -eq 0 ]
then
printf '\n\n\t\t\t%s\n\t\t\t\t%s\n\t\t\t%s\n' "