Commit e074ba52 authored by Aurélio A. Heckert's avatar Aurélio A. Heckert

Support crazy dates (ups)

parent 3e9e31ee
......@@ -85,28 +85,28 @@ download $url $slug.ORIG.html
if (grep -q 'id="data"' $slug.ORIG.html); then
if (egrep -q '<span id="data">Atualizado em\s*</span>' $slug.ORIG.html); then
pub_day=1
pub_month=1
pub_day=01
pub_month=01
pub_year=1999
pub_time=12:00
else
eval $(grep 'id="data"' $slug.ORIG.html |
sed -r 's#.*<span id="data">Atualizado em ([0-9]+)( [ae] [0-9]+|[0-9, ]*)? DE ([a-z]+)( DE ([0-9]+))?( ás ([0-9:]+))?</span>.*#\
pub_day=\1;\
pub_month=\3;\
pub_year=\5;\
pub_time=\7:00;\
#i')
test ${#pub_day} -lt 2 && pub_day="0$pub_day"
test $pub_time = ':00' && pub_time=12:00
test -z "$pub_year" && pub_year=1999
m_num=0
for m in jan fev mar abr mai jun jul ago set out nov dez; do
m_num=$(($m_num+1))
pub_month=$(echo $pub_month | sed "s/$m[a-z]*/$m_num/")
done
test ${#pub_month} -lt 2 && pub_month="0$pub_month"
fi
eval $(grep 'id="data"' $slug.ORIG.html |
sed -r 's#.*<span id="data">Atualizado em ([0-9]+)( [ae] [0-9]+|[0-9, ]*)? DE ([a-z]+)( DE ([0-9]+))?( ás ([0-9:]+))?</span>.*#\
pub_day=\1;\
pub_month=\3;\
pub_year=\5;\
pub_time=\7:00;\
#i')
test ${#pub_day} -lt 2 && pub_day="0$pub_day"
test $pub_time = ':00' && pub_time=12:00
test -z "$pub_year" && pub_year=1999
m_num=0
for m in jan fev mar abr mai jun jul ago set out nov dez; do
m_num=$(($m_num+1))
pub_month=$(echo $pub_month | sed "s/$m[a-z]*/$m_num/")
done
test ${#pub_month} -lt 2 && pub_month="0$pub_month"
pub="$pub_year-$pub_month-${pub_day}T$pub_time+300"
else
pub="$(date +%FT%T+300)"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment