Skip to content

Instantly share code, notes, and snippets.

@toguri
Created January 23, 2016 07:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save toguri/6aed8d4599516611720e to your computer and use it in GitHub Desktop.
Save toguri/6aed8d4599516611720e to your computer and use it in GitHub Desktop.
casperSS
var casper = require('casper').create();
var url = casper.cli.get(0);
var savePath = casper.cli.get(1);
var milsec = new Date().getTime();
var saveFile = savePath + "/" + milsec + ".png";
casper.start();
casper.userAgent('Mozilla/5.0 (iPhone; CPU iPhone OS 7_0 like Mac OS X) AppleWebKit/537.51.1 (KHTML, like Gecko) Version/7.0 Mobile/11A465 Safari/9537.53');
casper.viewport(750, 1334);
casper.open(url);
casper.then(function() {
this.capture(saveFile);
});
casper.run();
#!/bin/sh
URL=$1
FILE_PATH=$2
echo $1
echo $2
casperjs $HOME/bin/ss.js $1 $2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment