W3C home > Mailing lists > Public > www-validator@w3.org > July 2015

Re: Validator no longer includes counts

From: Michael[tm] Smith <mike@w3.org>
Date: Mon, 27 Jul 2015 09:18:04 +0900
To: "Cutchins, Stephen" <stephen.cutchins@accenturefederal.com>
Cc: "www-validator@w3.org" <www-validator@w3.org>, "Lacombe, William L." <william.l.lacombe@accenturefederal.com>, "Kandadai, Srikanth" <srikanth.kandadai@accenturefederal.com>
Message-ID: <20150727001804.GD31280@sideshowbarker.net>
"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

This archive was generated by hypermail 2.3.1 : Tuesday, 1 March 2016 14:18:13 UTC