Differencing with HTML Match

Opinion
Sep 11, 20064 mins

An interesting question came up on a list we subscribe to: How can you compare two versions of a Web page to see what changes have been made?

This question was raised by someone acting as an expert witness in a case of Web-site plagiarism. Following the obligatory flurry of legal shots, the offender agreed to make changes. Now the problem is determining if changes have been made.

Making a copy of a site isn’t hard – the wGet utility is one of the easiest tools for this. Everyone running a *n*x (that abbreviation covers all *nix versions as well as Linux) should find wGet already installed.

For Windows you’ll want to visit the Wget on Windows page for the Win32 version, and you’ll want to acquire the wGetGUI front end for wGet, which gives you a GUI that helps you run wGet using a batch file it creates.

So, getting a copy of the Web content is easy, and to do the comparison or differencing of a recent version of the site and a previous one, most *n*x people would use the diff utility, while Windows users might use Microsoft’s File Compare utility or the newer WinDiff.

WinDiff comes as part of the Windows XP Service Pack 2 Support Tools, or if you don’t want to install the Windows Genuine Advantage plug-in (a prerequisite for downloading and perhaps the dumbest antipiracy scheme so far), you can download WinDiff from Keith Devens’ site.

WinDiff is reasonably good, but not great, at showing how the two input files differ and provides a few options for what information is displayed about changes. Oddly, on our Windows XP Professional SP2 computer, the tool seems to have some fairly serious GUI maintenance problems, such as not completely redrawing the display. But what WinDiff doesn’t do is make it easy to deal with the fact that the offending Web site was edited with Microsoft FrontPage.

FrontPage and other editing programs add their own markup with wild abandon, so although you can see which content has been changed, figuring out whether the changes lie solely in the markup can be difficult. What is needed is a differencing tool that can filter the inputs in useful ways.

HTML Match, from Salty Brine Software, is designed for exactly this kind of work. Salty Brine also publishes FreeDiff, a simpler (and free) differencing tool.

HTML Match lets you compare original and revised content from locally accessible files or from URLs (the program downloads the content to a temporary local file). You also can compare local files with URL-derived content, and you can select to see just the visual differences, the underlying source code or the embedded text content. Finally, you can see the differences, shown at character, word or line levels of detail.

You also can choose whether text extraction should be done by HMTL Match’s built-in text-extraction engine, followed by Microsoft Word (if that is installed) if the internal engine fails – or vice versa, to make sure that if the content is hard to analyze, you stand a chance of getting at whatever text might exist. There also are options -such as ignore white space and ignore case – to filter the content further.

The displays are color-coded to highlight the differences, and you can set bookmarks (these disappear when the files are closed), jump to an editor to modify the files, and print the analysis for either or both files showing all lines, just the differing lines or just the identical lines. You also can run the program using command-line arguments, and have the option to save the results in an HTML file (normal operation doesn’t support saving the differences report in a file).

There are many tools for differencing, but of all we’ve looked at, HTML Match is the best. At $27.95 it is a steal.