Sha256: 83737fce0dd7e90bbb9942203fde1ffe3f8d5473a84c612b9614a9366df15f40

Contents?: true

Size: 604 Bytes

Versions: 1

Compression:

Stored size: 604 Bytes

Contents

var fs = require('fs');
var page = require('webpage').create();
var system = require('system');

var args = system.args;

var scriptDir = args[0].replace(/googlecharts-convert\.js$/,'')
var config = fs.read(args[1])
var pageContent = fs.read(scriptDir + 'template.html')
pageContent = pageContent.replace(/\$\{CONFIG}/g, config);

var path = args[1] + '.html';
fs.write(path, pageContent, 'w');

page.viewportSize = {
    width: 1024,
    height: 768
};

page.open(args[1] + '.html', function() {
    window.setTimeout(function () {
        page.render(args[2]);
        phantom.exit();
    }, 3000);
});

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
asciinurse-0.1.5 resources/googlecharts/converter/googlecharts-convert.js