<commit_before>'use strict';
let https = require('https');

/**
 * Pass the data to send as `event.data`, and the request options as
 * `event.options`. For more information see the HTTPS module documentation
 * at https://nodejs.org/api/https.html.
 *
 * Will succeed with the response body.
 */
exports.handler = (event, context, callback) => {
    // Sets request options
    var options = {
        host: 'hooks.slack.com',
        port: '443',
        path: '/services/[WEBHOOK_KEY_GOES_HERE]',
        method: 'POST',
        headers: {
          'Content-Type': 'application/json'
        }
    };

    // Sets the request body    
    var data = {
        "text": "Hello World from AWS Lambda!"
    };

    const req = https.request(options, (res) => {
        let body = '';
        console.log('Status:', res.statusCode);
        console.log('Headers:', JSON.stringify(res.headers));
        res.setEncoding('utf8');
        res.on('data', (chunk) => body += chunk);
        res.on('end', () => {
            console.log('Successfully processed HTTPS response');
            // If we know it's JSON, parse it<commit_msg>Update index.js<commit_after>'use strict';
let https = require('https');

/**
 * Pass the data to send as `event.data`, and the request options as
 * `event.options`. For more information see the HTTPS module documentation
 * at https://nodejs.org/api/https.html.
 *
 * Will succeed with the response body.
 */
exports.handler = (event, context, callback) => {
    // Checks the event details
    console.log(JSON.stringify(event, null, 2));
    
    // Sets request options
    var options = {
        host: 'hooks.slack.com',
        port: '443',
        path: '/services/[WEBHOOK_KEY_GOES_HERE]',
        method: 'POST',
        headers: {
          'Content-Type': 'application/json'
        }
    };

    // Sets the request body    
    var data = {
        "text": "New push has come up by " + event.head_commit.author.name + " with commit Id of " + event.head_commit.id
    };

    const req = https.request(options, (res) => {
        let body = '';
        console.log('Status:', res.statusCode);
        console.log('Headers:', JSON.stringify(res.headers));
        res.setEncoding('utf8');
        res.on('data', (chunk) => body += chunk);
        res.on('end', () => {
            console.log('Successfully processed HTTPS response');
            // If we know it's JSON, parse it
{'fraction_non_alphanumeric': 0.14981427981840692, 'fraction_numerical': 0.003714403631861329, 'mean_word_length': 2.3480662983425415, 'pattern_counts': {'":': 2, '<': 3, '<?xml version=': 0, '>': 11, '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': '4888440', 'n_tokens_mistral': 718, 'n_tokens_neox': 706, 'n_words': 200}