<commit_before>let express = require('express');
let bodyParser = require('body-parser');
let app = express();
let jsonParser = bodyParser.json();
let request = require('request');

app.use(bodyParser.json());
app.use(bodyParser.urlencoded({extended: true}));

app.get('/', function (req, res) {
    res.send('Slack Commands!');
});

app.all('/github', jsonParser, function (req, res) {
    console.log(req.params);
    console.log(req.body);

    let username = req.body.text || req.body.user_name || 'eddiejaoude';
    console.log(`username: ${username}`);

    request({
        url: `http://api.github.com/users/${username}/events`,
        headers: {
            'Accept': 'application/vnd.github.v3+json',
            'User-Agent': 'SlackCmds',
        }
    }, function (error, response, body) {
        let data = JSON.parse(body).slice(0, 3).map((item) => {
            return {
                'title': item.type,
                "author_name": item.actor.display_login,
                "thumb_url": item.actor.avatar_url,
                'ts': Date.parse(item.created_at),
                "color": "#A7B99E"
            };
        });
        res.json(
            {
                "attachments": data
            }
        );
    })
});

let port = process.env.PORT || 3000;
app.listen(port, function () {
    console.log(`Example app listening on port ${port}!`)
});<commit_msg>Added pretext<commit_after>let express = require('express');
let bodyParser = require('body-parser');
let app = express();
let jsonParser = bodyParser.json();
let request = require('request');

app.use(bodyParser.json());
app.use(bodyParser.urlencoded({extended: true}));

app.get('/', function (req, res) {
    res.send('Slack Commands!');
});

app.all('/github', jsonParser, function (req, res) {
    console.log(req.params);
    console.log(req.body);

    let username = req.body.text || req.body.user_name || 'eddiejaoude';
    console.log(`username: ${username}`);

    request({
        url: `http://api.github.com/users/${username}/events`,
        headers: {
            'Accept': 'application/vnd.github.v3+json',
            'User-Agent': 'SlackCmds',
        }
    }, function (error, response, body) {
        let data = JSON.parse(body).slice(0, 3).map((item) => {
            return {
                'title': item.type,
                "author_name": item.actor.display_login,
                "thumb_url": item.actor.avatar_url,
                'ts': Date.parse(item.created_at),
                "color": "#A7B99E",
                "pretext": "Your latest activities on GitHub:"
            };
        });
        res.json(
            {
                "attachments": data
            }
        );
    })
});

let port = process.env.PORT || 3000;
app.listen(port, function () {
    console.log(`Example app listening on port ${port}!`)
});
{'fraction_non_alphanumeric': 0.17450842696629212, 'fraction_numerical': 0.007022471910112359, 'mean_word_length': 2.282258064516129, 'pattern_counts': {'":': 9, '<': 3, '<?xml version=': 0, '>': 5, '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': '266531', 'n_tokens_mistral': 894, 'n_tokens_neox': 864, 'n_words': 167}