RE: Validator no longer includes counts

Hi Michael,

Thanks for the reply. I will have the automation team look at this and see if we can get it working again.

Stephen Cutchins, CUA
Manager, Section 508
Accenture Federal Services
stephen.cutchins@accenturefederal.com
Office: 571-551-3529
Reston, VA Room 669-C

-----Original Message-----
From: Michael[tm] Smith [mailto:mike@w3.org] 
Sent: Sunday, July 26, 2015 8:18 PM
To: Cutchins, Stephen <stephen.cutchins@accenturefederal.com>
Cc: www-validator@w3.org; Lacombe, William L. <william.l.lacombe@accenturefederal.com>; Kandadai, Srikanth <srikanth.kandadai@accenturefederal.com>
Subject: 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@DM2PR10M

> B0301.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 14:06:06 UTC