This shell command will retrieve a Web page and validate the HTML with Tidy, the HTML linter from the W3. You can get an XHTML validation report right in your shell prompt, just like you'd get from the Firefox extension or the Web service.. It's especially helpful when you need to validate HTML on your intranet, or behind a firewall.NOTE: Curl does not follow redirects by default!
By default, Curl retrieves exactly the URL you specify. The
-L option causes Curl to follow redirects just like a Web browser would.
Windows users should make sure their command prompt screen buffer height is set to 9999 so that you don't "lose" any output.Explanation of the command line options
curl -L tells Curl to foLLow HTTP redirects
curl -s Suppresses Curl's annoying progress bar
tidy -e tells Tidy not to Emit the tidied HTML to the console
tidy -q tells Tidy to be Quiet, instead of printing extra crap at the bottom of the report
Curl and Tidy are installed via the Cygwin setup.exe
Alternately, Perl hackers could use lwp-request.Doing more
Validate HTML with a stricter algorithm, using the OpenJade SGML parser.
Validate linked pages with Tidy and lwp-request.
You need to login to post a comment.