<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
<title>Snipplr</title>
<link>http://snipplr.com/language/bash/tags/validation</link>
<description>Recent snippets posted on Snipplr.com</description>
<language>en-us</language>
<pubDate>Fri, 24 May 2013 09:19:03 GMT</pubDate>
<item>
<title>(Bash) Howto run Tidy from the command line - noah</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>(Bash) HTTP Proxy Checker - sensimevanidus</title>
<link>http://snipplr.com/view/17899/http-proxy-checker/</link>
<description><![CDATA[ <p>This script tries to detect whether an HTTP Proxy works or not. It uses the HEAD command (high-level version of the lwp-request command) to connect to a given URL (http://www.google.com by default) via the given HTTP Proxy.
It takes 2 arguments; the first one is the IP Address or URL of the HTTP Proxy and the second one is its port number.
If you have a simpler or faster method, please let me know.</p> ]]></description>
<pubDate>Tue, 04 Aug 2009 17:40:23 GMT</pubDate>
<guid>http://snipplr.com/view/17899/http-proxy-checker/</guid>
</item>
<item>
<title>(Bash) Validate XHTML with Tidy and/or OpenJade, just like the FF extension - noah</title>
<link>http://snipplr.com/view/4970/validate-xhtml-with-tidy-andor-openjade-just-like-the-ff-extension/</link>
<description><![CDATA[ <p>Neither command will give any feedback unless invalid markup is found.</p> ]]></description>
<pubDate>Sun, 10 Feb 2008 02:14:45 GMT</pubDate>
<guid>http://snipplr.com/view/4970/validate-xhtml-with-tidy-andor-openjade-just-like-the-ff-extension/</guid>
</item>
<item>
<title>(Bash) check linked pages for Tidy validation errors, on the command line - noah</title>
<link>http://snipplr.com/view/4130/check-linked-pages-for-tidy-validation-errors-on-the-command-line/</link>
<description><![CDATA[ <p>Given a list of HTML links (for example, a Google results page that has been saved locally) check each link that points to a page on a given domain, and report if Tidy complains that its doctype declaration is missing.

Besides DOCTYPE, other strings to search for include "discarding", "lacks value" and "Error:"

Remember to replace MY_DOMAIN with the actual domain you want to validate against.</p> ]]></description>
<pubDate>Tue, 13 Nov 2007 23:47:28 GMT</pubDate>
<guid>http://snipplr.com/view/4130/check-linked-pages-for-tidy-validation-errors-on-the-command-line/</guid>
</item>
<item>
<title>(Bash) Validate a list of Web pages with Tidy, on the command line - noah</title>
<link>http://snipplr.com/view/4129/validate-a-list-of-web-pages-with-tidy-on-the-command-line/</link>
<description><![CDATA[ <p></p> ]]></description>
<pubDate>Tue, 13 Nov 2007 22:54:37 GMT</pubDate>
<guid>http://snipplr.com/view/4129/validate-a-list-of-web-pages-with-tidy-on-the-command-line/</guid>
</item>
<item>
<title>(Bash) Tidy xhtml - noah</title>
<link>http://snipplr.com/view/2671/tidy-xhtml/</link>
<description><![CDATA[ <p>Tidy the file named input.html.  Indent the code, don't wrap, write output to output.html.</p> ]]></description>
<pubDate>Fri, 18 May 2007 12:46:29 GMT</pubDate>
<guid>http://snipplr.com/view/2671/tidy-xhtml/</guid>
</item>
</channel>
</rss>