Skip to content

Instantly share code, notes, and snippets.

@divarvel
Created March 10, 2015 09:11
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save divarvel/d2296c53710dc10b9919 to your computer and use it in GitHub Desktop.
Save divarvel/d2296c53710dc10b9919 to your computer and use it in GitHub Desktop.
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