speedata / comparewebsites

Compare two websites by taking screenshots of pages and visually comparing each.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Compare two websites

Compare two websites by taking screenshots of pages and visually comparing each.

Prerequisites

You need a Go compiler, PhantomJS and ImageMagick (preferably version 7 and above).

Usage

You can supply zero or more JSON files that lists URLs to take screenshots and optionally two directories with screenshots to compare.

Usage: cmpimages [.json*] [dir1 dir2]

The JSON files must have this format:

[
 	"https://www.example.com/",
 	"https://www.example.com/path/to/page.html",
 	"https://www.example.com/anotherpath/"
]

The screenshots are crated in a sub directory of the current working directory called screenshots.

Building

git clone https://github.com/speedata/comparewebsites
cd comparewebsites
make

Now you should have a file called cmpimages. Try to run it:

./cmpimages example/example.json screenshots/www.speedata.de/de/ screenshots/www.speedata.de/en/

Which does two things:

  1. Create a directory called screenshots in the current working directory and save screenshots of the given web pages (the json files).
  2. Create a directory $TMPDIR/cmpimage-diff and writes a web page called out.html. This page shows the differences. Another file called diff.json in the current working directory lists all the pages which have differences.

Caveats

This is tested only on a Mac, feedback etc. is welcome. First version. ImageMagick < version 7 does not compare files with different sizes, so expect strange output in the HTML file.

Contact

gundlach@speedata.de

About

Compare two websites by taking screenshots of pages and visually comparing each.


Languages

Language:Go 99.5%Language:Makefile 0.5%