Skip to content

Commit

Permalink
Add phantom script
Browse files Browse the repository at this point in the history
  • Loading branch information
jefflembeck committed Oct 27, 2014
1 parent 3fe9f57 commit c786187
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions lib/screenshotter.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/*global phantom:true*/
/*global require:true*/
/*global window:true*/

/*
phantom args
[0] - url
[1] - output
*/
(function(){
"use strict";

var page = require( "webpage" ).create();

var site = phantom.args[0],
output = phantom.args[1];

page.open( site, function( status ){
if( status !== "success" ){
phantom.exit( 1 );
}
page.render( output + ".png" );
phantom.exit( 0 );
});

}());

0 comments on commit c786187

Please sign in to comment.