<commit_before>'use strict';

var request = require('request');

var opts = {
    uri: 'https://api.github.com' + '/users/' + process.argv[2] + '/events',
    json: true,
    method: 'GET',
    headers: {
        'User-Agent': 'nodejs script'
    }
}

request(opts, function (err, res, body) {
    if (err) throw new Error(err);

    var format = '[%s]: %s %s %s %s';

    for (var i = 0; i < body.length; i++) {
        console.log(format
            , body[i].created_at
            , body[i].type
            , body[i].actor.login
            , body[i].repo.name);
    }
});<commit_msg>Show usage text and exit if missing user-name parameter<commit_after>'use strict';

var request = require('request');

var opts = {
    uri: 'https://api.github.com' + '/users/' + process.argv[2] + '/events',
    json: true,
    method: 'GET',
    headers: {
        'User-Agent': 'nodejs script'
    }
}

if (! process.argv[2]) {
    console.log('Usage: nodejs gevents.js <user-name>');
    process.exit(0);
}

request(opts, function (err, res, body) {
    if (err) throw new Error(err);

    var format = '[%s]: %s %s %s %s';

    for (var i = 0; i < body.length; i++) {
        console.log(format
            , body[i].created_at
            , body[i].type
            , body[i].actor.login
            , body[i].repo.name);
    }
});
{'fraction_non_alphanumeric': 0.1870286576168929, 'fraction_numerical': 0.004524886877828055, 'mean_word_length': 2.2053140096618358, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 4, 'https://': 2, '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': '41044', 'n_tokens_mistral': 464, 'n_tokens_neox': 457, 'n_words': 113}