Sign inSign up

gongzhang/webpage-diff

By gongzhang

•Updated about 7 years ago

Diff a web page in Docker.

Image
0

216

gongzhang/webpage-diff repository overview

⁠webpage-diff

Diff a web page in Docker. Inspired by https://github.com/fouber/page-monitor⁠.

⁠Getting Started

Run the docker image with a exposed port and a data directory:

docker run --rm -it --name webpage-diff \
    -v $PWD/data:/app/data \
    -p 8000:8000 \
    gongzhang/webpage-diff

Then run this code (multiply times) in Node.js:

const { Client } = require('procbridge') // npm i procbridge
const client = new Client('127.0.0.1', 8000);

(async () => {
  const result = await client.request('capture', {
    url: 'http://kcb.sse.com.cn', // the page you want to diff
    options: {
      // Doc: https://github.com/fouber/page-monitor/blob/master/index.js#L57-L179
      page: {
        viewportSize: {
          width: 1024,
          height: 768
        }
      }
    }
  })
  console.log(result)
})()

Get the result in data directory.

Tag summary

Content type

Image

Digest

Size

419.6 MB

Last updated

about 7 years ago

docker pull gongzhang/webpage-diff