-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
So that the Linux lovers on the team can get some of the action.
- Loading branch information
Paul M Furley
committed
Jan 6, 2016
1 parent
d61842f
commit 243bd39
Showing
3 changed files
with
39 additions
and
4 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#!/usr/bin/env phantomjs | ||
|
||
|
||
var page = require('webpage').create(), | ||
system = require('system'), | ||
address; | ||
|
||
if (system.args.length != 3) { | ||
console.log('Usage: ' + system.args[0] + ' <some URL> <width in pixels>'); | ||
phantom.exit(); | ||
} | ||
|
||
page.viewportSize = { | ||
width: system.args[2], | ||
height: 768 | ||
}; | ||
|
||
address = system.args[1]; | ||
page.open(address, function(status) { | ||
if (status !== 'success') { | ||
console.log('FAIL to load the address'); | ||
} else { | ||
page.render(address.replace(/[^a-z0-9]/gi, '_').toLowerCase() + '.png'); | ||
} | ||
phantom.exit(); | ||
}); |
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