@magnet.me/site-diff
Pull a web page, select a part based on a selector, and check whether it changed with respect to the previous hash.
Last updated a year ago by alexkolpa .
MIT · Original npm · Tarball · package.json
$ cnpm install @magnet.me/site-diff 
SYNC missed versions from official npm registry.

Magnet.me

Dependency Status

Site diff

Pull a web page, select a part based on a selector, and check whether it changed with respect to the previous hash.

To query without a previous hash: http://site-diff/changed?url=https%3A%2F%2Fmagnet.me%2F&selector=body

To query with a previous hash: http://site-diff/changed?url=https%3A%2F%2Fmagnet.me%2F&selector=body&hash=e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855

Then return a json object so the caller can see whether it should take action.

{
  "hashes": {
     "previous": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
     "new": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
  },
  "changed": false,
  "empty": false,
  "found": "",
  "prerendered": true,
  "selector": "#currentPageInfo",
  "url": "https://magnet.me/sdfdsf"
}

Optionally pass in a PRERENDER_URL env var to ensure that the content is passed through a prerender service. That way any Javascript can be executed so dynamic pages can be crawled as well.

Current Tags

  • 1.1.2                                ...           latest (a year ago)

4 Versions

  • 1.1.2                                ...           a year ago
  • 1.1.1                                ...           2 years ago
  • 1.1.0                                ...           2 years ago
  • 1.0.0                                ...           3 years ago
Downloads
Today 1
This Week 1
This Month 1
Last Day 0
Last Week 0
Last Month 0
Dependencies (5)
Dev Dependencies (1)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |