Saturday, February 13, 2016

Runtime System: Node.js

node.js

H ZETT M & まらしぃ: 新曲

Logical Emotion (ろじえも): 千本桜

Patti LuPone: As If We Never Said Goodbye

Patti LuPone

Phantom JS: Creating PNG Image File of the Specified URL

Creating PNG image file of the specified URL

pagerender.js:
var page = require('webpage').create(),
  system = require('system'),
  address;

if (system.args.length <= 2) {
  console.log('Usage: pagerender.js <some URL> <image name>');
  phantom.exit();
}

address = system.args[1];
image = system.args[2];

page.open(address, function(status) {
  console.log("Status: " + status);
  if(status === "success") {
    page.render(image);
  }
  phantom.exit();
});

Command:

$ phantomjs pagerender.js http://smashingtheory.blogspot.com test.png

Headless Browser: PhantomJS

PhantomJS

Wednesday, February 10, 2016