This module allows you to search google by scraping the results. It does NOT use the Google Search API. PLEASE DO NOT ABUSE THIS. The intent of using this is convenience vs the cruft that exists in the Google Search API.
This is not sponsored, supported, or affiliated with Google Inc.
npm install google
This prints out the first 50 search results of the query node.js best practices
.
var google = require('google');
google.resultsPerPage = 25;
var nextCounter = 0;
google('node.js best practices', function(err, next, links){
if (err) console.error(err);
for (var i = 0; i < links.length; ++i) {
console.log(links[i].title + ' - ' + links[i].link);
console.log(links[i].description + "\n");
}
if (nextCounter < 4) {
nextCounter += 1;
if (next) next();
}
});
npm test
or...
mocha test
Licensed under MIT. See LICENSE
for more details.
Copyright (c) 2012 JP Richardson