Better validation report for your web site
Par obi, Monday 17 October 2005 à 12:14 :: Work :: #65 :: rss
Once your web site sarts to have less errors thanks to the previous script , you will enjoy a shorter one, only reporting pages with errors and a count oof them in the subject to track your progression.
- !/bin/bash
log=/tmp/rsync-Web-site-$(date +%Y%m%d).log #TIDY=tidy TIDY=/usr/local/rsyncclient/tidy tmpValid=/tmp/am-autoweb-valid.txt tmpMail=/tmp/am-autoweb-mail.txt rm -f $tmpMail pageList=$(wget http://www.esterel-technologies.com/admin/allUrls.php -O - -q) i=0 invalid=0 nbErrors=0 echo "ET Web validation ( $(date) )" >> $tmpMail for page in $pageList do i=$localName="/tmp/am-autoweb-$i.html" ##Get the page in /tmp/$fileName wget -q $page -O $localName >/dev/null ${TIDY} -o /dev/null -q -utf8 -f $tmpValid $localName validation_result=$(cat $tmpValid) if -z "$validation_result" then echo ".">/dev/null else invalid=$
echo "$invalid. $page" >>$tmpMail echo $validation_result >>$tmpMail echo "" >>$tmpMail errorsInThisFile=$(cat $tmpValid | wc -l ) nbErrors=$
fi rm -f $localName rm -f $tmpValid done echo "Analysed $i pages" >>$log echo "Found $nbErrors errors in $invalid pages" >>$log cat $tmpMail >>$log rm -f $tmpMail mail -s "ET Web Validation (${nbErrors}) " your@email.here < $log rm -f $log
Commentaires
Aucun commentaire pour le moment.
Ajouter un commentaire
Les commentaires pour ce billet sont fermés.