Skip to content

Instantly share code, notes, and snippets.

@uu59
Created January 29, 2011 06:54
Show Gist options
  • Save uu59/801626 to your computer and use it in GitHub Desktop.
Save uu59/801626 to your computer and use it in GitHub Desktop.
if (phantom.state.length === 0) {
if (phantom.args.length !== 1) {
console.log('Usage: aa.js imagename');
phantom.exit();
} else {
var address = 'http://amachang.sakura.ne.jp/misc/aamaker/';
phantom.state = 'aamaker';
phantom.viewportSize = { width: 600, height: 100 };
phantom.open(address);
}
} else {
try {
var m = document.querySelectorAll('p#target')[0].innerHTML;
document.body.innerHTML = m;
} catch(e){
}
document.body.style.background = '#fff';
document.body.style.fontSize = '60pt';
document.body.style.margin = '0';
document.body.style.padding = '0';
var output = phantom.args[0];
phantom.sleep(200);
phantom.render(output);
phantom.exit();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment