Skip to content

Instantly share code, notes, and snippets.

@jrm2k6
Created July 9, 2013 21:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jrm2k6/5961486 to your computer and use it in GitHub Desktop.
Save jrm2k6/5961486 to your computer and use it in GitHub Desktop.
var loadUsingCheerio = function(result){
return cheerio.load(result);
}
var cheerioURLContent = function(url, callback) {
rest.get(url).on("complete", function(result){
callback(result);
});
}
var checkContentFromURL = function(contentFromUrl, checksfile) {
$ = cheerioURLContent(contentFromUrl, loadUsingCheerio);
var checks = loadChecks(checksfile).sort();
var out = {};
for(var ii in checks) {
var present = $(checks[ii]).length > 0;
out[checks[ii]] = present;
}
return out;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment