Created
July 22, 2017 11:34
-
-
Save sungwoncho/02157bd053a685f6f85f62446f8923df to your computer and use it in GitHub Desktop.
A script to capture slides from reveal.js presentation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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