webtouch
npm install webtouch
Validate that a web site and all its required resources are available.
var webtouch = require('webtouch')
webtouch('http://www.google.com', function (e, urls) {
if (e) throw e
console.log(urls)
})The website will be parsed and all the resources in the html will be touched via an HTTP GET.
There's also an event emitter returned that you can use to monitor.
webtouch('http://www.google.com').on('get', function (url) {console.log("fetching", url)})webtouch(urls, [opts], cb)
urlsEither a string for a single url or an array of urls.optstimeoutA timeout in millisecond for each GET, this is not a timeout for the entire crawl.imgFetch images, defaults totrue.metaFetch images in meta tags whereitemprop === "image", defaults totrue.scriptFetch scripts, defaults to true.aFetch and parse links, defaults tofalse. This method is dangerous since it basically turns webtouch in to a crawler that could potentially never return.
cbfunction (error, urls) {}returns all of the urls that have been touched.
events
getfunction (url){}The url that is about to be touched.respfunction (response, url){}The http.ClientResponse object and url that was just touched.