Install phantomJs
Run:
[sudo] npm install --global phantomjsRun:
./phantomjs screen.jsRun:
[sudo] npm install --global phantomjsRun:
./phantomjs screen.js| /* jshint undef: true, unused: true, curly: true, forin: true, node: true, phantom: true, noempty: true */ | |
| 'use strict'; | |
| var sites = [ | |
| 'http://gistoapp.com', | |
| 'http://www.sanusart.com', | |
| 'http://atom.io' | |
| ]; | |
| sites.forEach(function(site, index) { | |
| index++; | |
| console.log('Site ' + index + ' out of ' + sites.length); | |
| var page = require('webpage').create(); | |
| console.log('Site: ', site); | |
| page.settings.userAgent = 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2062.120 Safari/537.36'; | |
| page.viewportSize = { | |
| width: 1366, | |
| height: 768 | |
| }; | |
| page.clipRect = { | |
| top: 0, | |
| left: 0, | |
| width: 1366, | |
| height: 768 | |
| }; | |
| page.open(site, function() { | |
| page.render(site.split('//')[1] + '.png'); | |
| if (index === sites.length) { | |
| phantom.exit(); | |
| } | |
| }); | |
| }); |