Re: Validator no longer includes counts

"Cutchins, Stephen" <stephen.cutchins@accenturefederal.com>, 2015-07-24 14:03 +0000:
> Archived-At: <http://www.w3.org/mid/DM2PR10MB030133DDBE2C1D909C424E88F6810@DM2PR10MB0301.namprd10.prod.outlook.com>
> 
> Hi,
> 
> We have been using Validator with an automated test script for a Federal
> project.  Roughly a week ago or so, the counts were removed from
> Validator which is causing our automated test scripts to fail since this
> is what we were checking against.
> 
> Is there a way to add the counts back?  We would very much appreciate it!

You can use the JSON output from the W3C HTML Checker and programatically
count the number of message types you’re interested in; for example:

  https://validator.w3.org/nu/?doc=https://accenturefederal.com&out=json

If you’re interested only in the error count, your test scripts can
programatically count just the “type: error” items in that JSON output. If
you’re interested in warnings as well, your test scripts can also count the
“type: info” items that have a “subtype: warning” property.

Depending on what kind of test scripts you’re using, there are other
machine-parsable output formats you might want to try:

  https://validator.w3.org/nu/?doc=https://accenturefederal.com&out=xml
  https://validator.w3.org/nu/?doc=https://accenturefederal.com&out=gnu

The out=gnu format puts each message on a single line, so your test script
could get an error count from that just by piping a few commands together:

  curl -s "https://validator.w3.org/nu/?doc=https://accenturefederal.com&out=gnu" | grep ": error:" | wc -l

Or to get a count of the warnings:

  curl -s "https://validator.w3.org/nu/?doc=https://accenturefederal.com&out=gnu" | grep ": info warning:" | wc -l

-- 
Michael[tm] Smith https://people.w3.org/mike

Received on Monday, 27 July 2015 00:18:33 UTC