Take a screenshot of any tweet using Casper.js
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 url = phantom.casperArgs.args[0] | |
var output = phantom.casperArgs.args[0] | |
var casper = require('casper').create({ | |
pageSettings : { | |
userAgent : 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_2) AppleWebKit/535.11 (KHTML, like Gecko) Chrome/17.0.963.79 Safari/535.11' | |
} | |
}); | |
casper.start(url, function() { | |
this.captureSelector( output + '.png', '.permalink-inner .tweet'); | |
}); | |
casper.run(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment