Created
July 16, 2020 00:00
-
-
Save coord-e/f76e43e2249aed88737c96e77ec17b71 to your computer and use it in GitHub Desktop.
Validate HTML/CSS using Web API
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 | |
shopt -s globstar | |
for file in **/*.html; do | |
curl -fsS "https://validator.w3.org/nu/?out=gnu" \ | |
-H "Content-Type: text/html; charset=utf-8" \ | |
--data-binary "@$file" \ | |
| { ! grep -z error; } | |
done | |
for file in **/*.css; do | |
curl -fsS "https://jigsaw.w3.org/css-validator/validator" \ | |
-H "Content-Type: multipart/form-data" \ | |
-F warning=2 -F output=text -F "text=<$file" \ | |
| { ! grep -z errors; } | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment