Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
var casper = require('casper').create({
viewportSize: { width: 1024, height: 768 }
});
var i = 0;
var interval;
function takePictures() {
interval = setInterval(function(){
var n = ((i < 10) ? '0':'') + i;
casper.capture('image-' + (n) + '.jpg', {
top: 0,
left: 0,
width: 1024,
height: 768
});
i++;
}, 1000/8);
}
casper.start('http://casperjs.org/', function() {
takePictures();
casper.click('.nav li a');
});
casper.waitForUrl(/latest/, function(){
clearInterval(interval);
});
casper.run();
run:
casperjs index.js && convert *.jpg video.mpeg && gify video.mpeg out.gif && rm *.jpg video.mpeg
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.