<commit_before><commit_msg>added phantomjs script<commit_after>var system    = require ( 'system' ),
    webpage   = require( 'webpage' ),
    page      = webpage.create(),
    picture   = system.args[ 1 ],
    split     = picture.split( '|' ),
    url       = split[ 0 ],
    size      = split[ 1 ].split( 'x' ),
    width     = +size[ 0 ],
    height    = +size[ 1 ],
    indexPath = system.args[ 2 ];

page.onError = function ( msg ) {
    console.log(msg);
    phantom.exit();
};

page.onConsoleMessage = function( msg, lineNum, sourceId ) {
    console.warn(
      'CONSOLE: ' + msg + ' (from line #' + lineNum + ' in "' + sourceId + '")'
    );
};

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

page.clipRect = {
  height : height,
  width  : width
};


page.open( url, function( status ) {
  window.setTimeout( function() {
    var imgPath = indexPath +
                    'img/current/' +
                    url.replace( /(http:\/\/|https:\/\/)/, '').replace( /\//g, '-') +
                    '-' + width + 'x' + height +
                    '.png';

    console.log( 'Rendering ' + imgPath );
    page.render( imgPath );

    phantom.exit();
  }, 500 );
} );
{'fraction_non_alphanumeric': 0.17983193277310924, 'fraction_numerical': 0.007563025210084034, 'mean_word_length': 1.8907766990291262, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4525147', 'n_tokens_mistral': 413, 'n_tokens_neox': 389, 'n_words': 86}