<commit_before>ZiggeoSdk = require("../index.js");
var fs = require('fs');
var app_token = process.argv[2];
var private_key = process.argv[3];
var video_token = process.argv[4];

ZiggeoSdk.init(app_token, private_key);

// you can find example of grants JSON at https://ziggeo.com/docs/api/authorization-tokens/examples
ZiggeoSdk.Videos.get (video_token, {
    success: function (video) {
        downloadVideo(video);
    }
});
function downloadVideo(video){
    ZiggeoSdk.Streams.download_image(video.token, video.default_stream.token, function(data){
        fs.writeFile(video.token+'.'+video.default_stream.token+'.jpg', data, function(err){<commit_msg>fixing function name for better representation<commit_after>ZiggeoSdk = require("../index.js");
var fs = require('fs');
var app_token = process.argv[2];
var private_key = process.argv[3];
var video_token = process.argv[4];

ZiggeoSdk.init(app_token, private_key);

// you can find example of grants JSON at https://ziggeo.com/docs/api/authorization-tokens/examples
ZiggeoSdk.Videos.get (video_token, {
    success: function (video) {
        downloadImage(video);
    }
});
function downloadImage(video){
    ZiggeoSdk.Streams.download_image(video.token, video.default_stream.token, function(data){
        fs.writeFile(video.token+'.'+video.default_stream.token+'.jpg', data, function(err){
{'fraction_non_alphanumeric': 0.1467753891771683, 'fraction_numerical': 0.004447739065974796, 'mean_word_length': 5.026785714285714, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6411876', 'n_tokens_mistral': 445, 'n_tokens_neox': 442, 'n_words': 82}