Validate With Logos

Validation Status: *

The image above comes from a service which validates the URI in the request's HTTP Referer header and returns either a smiling green (valid) or a frowning red (invalid) face depending on the results. So any page on this site which contains a link to that dynamic image will automatically let people see whether or not it's valid.

Though the live service only works for pages on this site by design, for obvious reasons, the source of the service is freely available so that anybody can run it on their own domain. It's just a small bash script and associated PNG files (see below). It uses the W3C's Markup Validation Service to do the grunt work, making use of its HTTP HEAD webservice for minimal overhead.

Background

The W3C's Validator has a URI which will check the refering link, so that when you follow a link to it, it'll validate the page you just came from. This is handy for authors since it gives them an easy way to validate pages, and the link is often referenced from one of the snazzy validation logos that the service encourages people to use.

But this method doesn't allow one to tell at a glance whether a page is valid or not, hence the idea of writing a CGI script that will return a PNG to indicate the status. I found out afterwards via Morbus Iff that the icab browser has a similar thing built in.

The Source Files

Here's what you need to run this service yourself:

Other assorted paraphenalia:

Note that the check script currently forces the XHTML 1.0 Strict doctype. This is because I don't tend to include a doctype on the pages in my site, instead preferring to use my own XHTML 1.0 subset and validate that using rnv and a RELAX NG schema I hacked up. But that's usually run periodically over the whole site, whereas this system provides more direct and immediate feedback.

Some further information about the motivation behind this service, some of the implementation details, and possibilities for the future can be found in Validation at a Glance. Danny Ayers has also expressed the hope that I'll deliver a similar service for the Feed and RDF Validators too, which may be a possibility.

Questions?

For feedback, general comments, or requests for help, try the Swhack IRC channel on Freenode. If you can't find help there, you may contact the author by email, or by using the following feedback form:

Your Email Address:

For discussion relating to the W3C's Validation service, try the www-validator mailing list.


Sean B. Palmer, inamidst.com