Thursday 29 September 2005
Receive the validity check of your web site by email
Par obi, Thursday 29 September 2005 à 17:18 :: Work
You need:
So it should be quite portable.
You also need the list of pages to validate. As my web strucure is managed by php, I creted a php page returning this list.
#!/bin/bash tmpValid=/tmp/autoweb-valid.txt tmpMail=/tmp/autoweb-mail.txt ##get list of pages pageList=$(wget http://www.esterel-technologies.com/admin/allUrls.php -O - -q) i=0 echo "ET Web validation ( $(date) )" >> $tmpMail for page in $pageList do i=$localName="/tmp/am-autoweb-$i.html" ##Get the page wget -q $page -O $localName >/dev/null echo "$i. $page" >>$tmpMail tidy -o /dev/null -q -utf8 -f $tmpValid $localName >> $tmpMail cat $tmpValid >> $tmpMail echo "" >> $tmpMail rm -f $localName rm -f $tmpValid done mail -s "Web Validation" your@email.here < $tmpMail rm -f $tmpMail
The neat thing is to use wget to retreive page, so:
- Tidy runs on the generated page, so it also checks the tags generated by php
- You can run the script from another machine than your web server. Great if you do not have a shell account on it.