parse dates from article link

This commit is contained in:
Morgan Wattiez 2019-08-05 12:56:04 +02:00
parent 56923b7d2e
commit 4ef633c7fa

View File

@ -78,7 +78,11 @@ function istherenewissues() {
echo "$LASTISSUE" > .newjiraissue
}
function greppagedate() {
year=$(curl -sSL "$*" | tr '<' '\r' | \egrep -i "date|datetime" -A 1 | \grep -Eo '\b[[:digit:]]{4}\b' | head -n1)
year=$(echo "$*" | egrep -Eo '\b[[:digit:]]{4}\b')
if [ -z "$year" ]
then
year=$(curl -sSL "$*" | tr '<' '\r' | \egrep -i "date|datetime" -A 1 | \grep -Eo '\b[[:digit:]]{4}\b' | head -n1)
fi
yearint=$(($year + 0))
currentyear=$(echo `date +"%Y"`)
if [[ $yearint -ge 1970 && $yearint -le $currentyear ]]