<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
<title>Snipplr - noah</title>
<link>http://snipplr.com/users/noah/tags/validate</link>
<description>Recent snippets posted on Snipplr.com</description>
<language>en-us</language>
<pubDate>Sun, 19 May 2013 21:42:52 GMT</pubDate>
<item>
<title>(Bash) Howto run Tidy from the command line</title>
<link>http://snipplr.com/view/27758/howto-run-tidy-from-the-command-line/</link>
<description><![CDATA[ <p>This shell command will retrieve a Web page and validate the HTML with [Tidy, the HTML linter from the W3](http://tidy.sourceforge.net/).  You can get an **XHTML validation** report right in your shell prompt, just like you'd get from the [Firefox extension](https://addons.mozilla.org/en-US/firefox/addon/249) or the [Web service.](validator.w3.org/).  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.

### **NOTE: Tidy produces a lot of output!**


Windows users should make sure their [command prompt screen buffer height is set to 9999](http://www.codinghorror.com/blog/archives/000334.html 'command prompt tips from Coding Horror') so that you don't "lose" any output.


### **Explanation of the command line options**

`curl -L` tells Curl to fo**LL**ow HTTP redirects

`curl -s` **S**uppresses Curl's annoying progress bar

`tidy -e` tells Tidy not to **E**mit the tidied HTML to the console

`tidy -q` tells Tidy to be **Q**uiet, instead of printing extra crap at the bottom of the report

### **Dependencies**

Curl and Tidy are installed via the [Cygwin setup.exe](http://cygwin.com/)

Alternately, Perl hackers could use [lwp-request](http://search.cpan.org/~gaas/libwww-perl-5.808/bin/lwp-request).

### **Doing more**

[Validate HTML with a stricter algorithm,](http://snipplr.com/view/4130/check-linked-pages-for-tidy-validation-errors-on-the-command-line/) using the OpenJade SGML parser.

[Validate linked pages](http://snipplr.com/view/4130/check-linked-pages-for-tidy-validation-errors-on-the-command-line/) with Tidy and lwp-request.</p> ]]></description>
<pubDate>Fri, 05 Feb 2010 12:41:54 GMT</pubDate>
<guid>http://snipplr.com/view/27758/howto-run-tidy-from-the-command-line/</guid>
</item>
<item>
<title>(JavaScript) validate email address when submitting a form</title>
<link>http://snipplr.com/view/2350/validate-email-address-when-submitting-a-form/</link>
<description><![CDATA[ <p>based on the 'valid email' snippet by krisdb</p> ]]></description>
<pubDate>Sat, 17 Mar 2007 10:17:53 GMT</pubDate>
<guid>http://snipplr.com/view/2350/validate-email-address-when-submitting-a-form/</guid>
</item>
</channel>
</rss>