Created
March 10, 2015 09:11
-
-
Save divarvel/d2296c53710dc10b9919 to your computer and use it in GitHub Desktop.
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 casper = require("casper").create(); | |
casper.start(); | |
var screenSize = [1024, 768]; | |
var frameCount = 68; | |
function slideUrl(i) { | |
return 'http://localhost:9000/slides.html#'+i+'.0' | |
} | |
function frameName(i) { | |
var n = i < 10 ? '0' + i : i; | |
return 'type-dd-n' + n + '.png'; | |
} | |
casper.wait(100, function() { | |
this.viewport(screenSize[0], screenSize[1]); | |
yolo(1); | |
}); | |
function yolo(i) { | |
if(i <= frameCount) { | |
casper.thenOpen(slideUrl(i)).then(function() { | |
casper.wait(200, function() { | |
this.capture(fromName(i)); | |
console.log("slide " + i); | |
}); | |
yolo(i + 1); | |
}); | |
} | |
} | |
casper.run(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment