-
-
Save mickaelandrieu/9367291 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({ | |
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(); |
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
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