<commit_before>// csvbuilder.js

const fs = require('fs');
const promise = require('bluebird');
const json2csv = require('json2csv');
const instaService = require('./insta.js');

const OUTPUT_FILEPATH = 'output.csv';

const MAX_DAYS = 90;
const MAX_POSTS = 2000;

const PROFILES = [
    'vascodagama',
    'therealbigsmo',
    'ludmilla',
    'comunidade_agua_viva',
    'comunidadeservir',
    'pretagil',
    'filipetoledo',
    'zsuzsubell',
    'swimmac_1977',
    'heliocastroneves'
];

const csvBuild = () => {
    return promise.mapSeries(PROFILES, profile => {
        return instaService.measure({
                profile: profile,
                digits: 4,
                maxDays: MAX_DAYS,
                maxPosts: MAX_POSTS,
                timeoutPerRequest: 60000
            })
            .then(result => {
                console.log(profile, 'finished');
                return {
                    insta_profile: result.profileInfo.username,
                    insta_posts_last_90d: result.postStats.totalSamples,
                    insta_avg_posts_per_week: result.postStats.avgPostsPerWeek,
                    insta_avg_comments_per_week: result.postStats.avgCommentsPerWeek,
                    insta_likes_per_post_q1: result.postStats.likesPerPost.q1,<commit_msg>builder-fixes<commit_after>// csvbuilder.js

const fs = require('fs');
const promise = require('bluebird');
const json2csv = require('json2csv');
const instaService = require('./insta.js');

const OUTPUT_FILEPATH = 'output.csv';

const MAX_DAYS = 90;
const MAX_POSTS = 2000;

const PROFILES = [
    'vascodagama',
    'therealbigsmo',
    'ludmilla',
    'comunidade_agua_viva',
    'comunidadeservir',
    'pretagil',
    'filipetoledo',
    'zsuzsubell',
    'swimmac_1977',
    'heliocastroneves'
];

const csvBuild = () => {
    return promise.mapSeries(PROFILES, profile => {
        return instaService.measure({
                profile: profile,
                digits: 4,
                maxDays: MAX_DAYS,
                maxPosts: MAX_POSTS,
                timeoutPerRequest: 60000
            })
            .then(result => {
                console.log(profile, 'finished');
                return {
                    insta_profile: result.profileInfo.username,
                    insta_posts_last_90d: result.postStats.totalSamples,
                    insta_avg_posts_per_week: result.postStats.avgPostsPerWeek,
                    insta_avg_likes_per_week: result.postStats.avgLikesPerWeek,
                    insta_avg_comments_per_week: result.postStats.avgCommentsPerWeek,
                    insta_likes_per_post_q1: result.postStats.likesPerPost.q1,
{'fraction_non_alphanumeric': 0.10307346326836582, 'fraction_numerical': 0.01649175412293853, 'mean_word_length': 2.2312348668280872, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, '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': '6364730', 'n_tokens_mistral': 896, 'n_tokens_neox': 826, 'n_words': 133}