Skip to content

Instantly share code, notes, and snippets.

@sungwoncho
Created July 22, 2017 11: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 sungwoncho/02157bd053a685f6f85f62446f8923df to your computer and use it in GitHub Desktop.
Save sungwoncho/02157bd053a685f6f85f62446f8923df to your computer and use it in GitHub Desktop.
A script to capture slides from reveal.js presentation
var webshot = require('webshot');
var maxSlideNumber = 17
var opt = { windowSize: { width: 1440
, height: 799 }};
webshot('https://sungwoncho.github.io/presentations/20170727-graphdb-node-stackoverflow.html#/', 'slide0.png', opt, function(err) {
if (err) {
console.log(err)
} else{
console.log('captured');
}
});
function captureNth(n) {
console.log('Capturing ' + n)
webshot('https://sungwoncho.github.io/presentations/20170518-what-i-learned-bootstrapping-startups-after-college.html#/' + n, 'slide' + n + '.png', opt, function(err) {
if (err) {
console.log(err)
} else{
console.log('captured' + n);
if (n <= maxSlideNumber) {
captureNth(n+1);
}
}
});
}
captureNth(1);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment