Skip to content

Commit

Permalink
Capture to file example
Browse files Browse the repository at this point in the history
  • Loading branch information
b4dnewz committed Jan 23, 2018
1 parent 7b3b690 commit 8b42176
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 2 deletions.
16 changes: 16 additions & 0 deletions example/capture-to-file.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
const socialScanner = require('../lib/index');

socialScanner('codekraft-studio', {
restrict: ['github'],
capture: true,
screenshotOptions: {
onlySuccess: false,
outputType: 'file'
}
}, (err, response) => {
if (err) {
console.log('Error:', err);
return;
}
console.log('Response:', response);
});
9 changes: 7 additions & 2 deletions example/simple.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
const socialScanner = require('../lib/index');

socialScanner('codekraft-studio', {}, (err, response) => {
socialScanner('b4dnEWZ', {
requestOptions: {
timeout: 1000
},
restrict: ['github']
}, (err, response) => {
if (err) {
console.log('Error:', err);
return;
}
console.log('Response:', response);
console.log('Response:', JSON.stringify(response, null, 2));
});

0 comments on commit 8b42176

Please sign in to comment.