Created
August 16, 2018 08:18
-
-
Save oliverlundquist/0f477b564c0e6aec598f52a71a942169 to your computer and use it in GitHub Desktop.
W3C html and css validation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
HTML_FILES=$(find ${1} -name '*.html' -type f) | |
CSS_FILES=$(find ${1} -name '*.css' -type f) | |
OUTPUT_FILE=results.txt | |
> $OUTPUT_FILE | |
for file in ${HTML_FILES[*]} | |
do | |
echo "File: $file" >> $OUTPUT_FILE | |
echo '--------------------------' >> $OUTPUT_FILE | |
curl -s -S -H "Content-Type: text/html; charset=utf-8" --data-binary "@$file" https://validator.w3.org/nu/?out=gnu >> $OUTPUT_FILE | |
echo '' >> $OUTPUT_FILE | |
done | |
for file in ${CSS_FILES[*]} | |
do | |
echo "File: $file" >> $OUTPUT_FILE | |
echo '--------------------------' >> $OUTPUT_FILE | |
curl -s -S -H "Content-Type: text/css; charset=utf-8" --data-binary "@$file" https://validator.w3.org/nu/?out=gnu >> $OUTPUT_FILE | |
echo '' >> $OUTPUT_FILE | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment