This module lets you easily use the Snapito APIs in node.js to create screenshots of web pages. You will need an api key that you can fetch here: http://snapito.com/api-doc-paid#apikeygen
Using npm:
npm install screenshot
You can also clone this repository into your node_modules directory.
var snapito = require('screenshot');
var screenshot = new snapito('yourapikey');
screenshot.screenshot('http://www.google.com', 'google.png', {screen: 'desktop'}, function(file){
if (file) {
console.log('The file ' + file + ' was written correctly');
} else {
console.log('Error');
}
});
Take a screenshot
You can pass a list of options to this method to customize the API call to Snapito. Here is a list of them:
var snapito = require('screenshot');
var screenshot = new snapito('yourapikey');
// screenshot.screenshot(url, file, options, callback)
screenshot.screenshot('http://www.google.com', 'google.png', {screen: 'desktop'}, function(file){
if (file) {
console.log('The file ' + file + ' was written correctly');
} else {
console.log('Error');
}
});