Skip to content

matsrorbecker/html-snok

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

html-snok

###A little tool for detecting changes on web pages.

Installation

First you need to install Node.js. After that, run the following command:

npm install matsrorbecker/html-snok

Usage

Example:

const HtmlSnok = require('html-snok');

const pagesToCheck = [
	'http://www.dn.se/'
]

const notify = function (link) {
	console.log("Hey, this page has been updated:");
	console.log(link);
}

const secondsBetweenChecks = 60;

const options = {
	selector: '.article-teaser-list'	
}

const htmlSnok = new HtmlSnok(pagesToCheck, notify, options);

setInterval(htmlSnok.sniff, secondsBetweenChecks * 1000);
htmlSnok.sniff();

Besides the link, the HTML and a cheerio object is passed to the callback.

License

This little piece of software is licensed under the terms of the ISC License.

About

A little tool for detecting changes on web pages

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published