<commit_before>var amqp = require('amqp');
var PHPUnserialize = require('php-unserialize');

var userCounter = require('./UserCountHandler');
var main = require('../index');

var mb_config = main.mb_config;

/*
 * Create a amap connection with config settings
 */
var conn = amqp.createConnection({
  host: mb_config.host,
  port: mb_config.port,
  login: mb_config.login,
  password: <PASSWORD>,
  connectionTimeout: mb_config.connectionTimeout,
  authMechanism: mb_config.authMechanism,
  vhost: mb_config.vhost,
  noDelay: mb_config.noDelay,
  ssl: { enabled : mb_config.ssl_enabled }
},
{
  defaultExchangeName: mb_config.defaultExchangeName
});

/*
 * Connect to queue & build HTML elements based off the data, push results
 * over SocketIO to clients
 */
conn.on('ready', function(){
  console.log('rabbit connection ready');
  var q = conn.queue('activityStatsQueue', {
    passive: mb_config.passive,
    durable: mb_config.durable,
    exclusive: mb_config.exclusive,
    autoDelete: mb_config.autoDelete
  }, function (q) {
    console.log('Queue ' + q.name + ' is open');

    q.bind('#');

    q.subscribe(function (message) {
      var serializedMessage = PHPUnserialize.unserialize(message.data.toString());
      var activity = serializedMessage.activity;
      switch(activity){
        case "user_register":
          userCounter.totalUsers++;
          main.sendActivityMessage('signup', '<p class="name">' + serializedMessage.merge_vars.FNAME + '</p> <p> created an account!</p>');
          break;
        case "campaign_signup" :
          main.sendActivityMessage('campaign', '<p class="name">' + serializedMessage.merge_vars.FNAME + "</p> signed up for <p>" + serializedMessage.merge_vars.CAMPAIGN_TITLE + "!</p>");
          break;
        case "campaign_reportback":
          main.sendActivityMessage('report back', '<p class="name">' + serializedMessage.merge_vars.FNAME + " </p> <p> reported back for " + serializedMessage.merge_vars.CAMPAIGN_TITLE + "!</p>");
          main.sendActivityMessage('report back image', serializedMessage.merge_vars.REPORTBACK_IMAGE_MARKUP);
          break;
        case "campaign_group_signup":
          break;
        case "user_password":
          break;
        default:
          break;
      }
    });

  });
});<commit_msg>Quick paragraph change<commit_after>var amqp = require('amqp');
var PHPUnserialize = require('php-unserialize');

var userCounter = require('./UserCountHandler');
var main = require('../index');

var mb_config = main.mb_config;

/*
 * Create a amap connection with config settings
 */
var conn = amqp.createConnection({
  host: mb_config.host,
  port: mb_config.port,
  login: mb_config.login,
  password: <PASSWORD>,
  connectionTimeout: mb_config.connectionTimeout,
  authMechanism: mb_config.authMechanism,
  vhost: mb_config.vhost,
  noDelay: mb_config.noDelay,
  ssl: { enabled : mb_config.ssl_enabled }
},
{
  defaultExchangeName: mb_config.defaultExchangeName
});

/*
 * Connect to queue & build HTML elements based off the data, push results
 * over SocketIO to clients
 */
conn.on('ready', function(){
  console.log('rabbit connection ready');
  var q = conn.queue('activityStatsQueue', {
    passive: mb_config.passive,
    durable: mb_config.durable,
    exclusive: mb_config.exclusive,
    autoDelete: mb_config.autoDelete
  }, function (q) {
    console.log('Queue ' + q.name + ' is open');

    q.bind('#');

    q.subscribe(function (message) {
      var serializedMessage = PHPUnserialize.unserialize(message.data.toString());
      var activity = serializedMessage.activity;
      switch(activity){
        case "user_register":
          userCounter.totalUsers++;
          main.sendActivityMessage('signup', '<p class="name">' + serializedMessage.merge_vars.FNAME + '</p> <p> created an account!</p>');
          break;
        case "campaign_signup" :
          main.sendActivityMessage('campaign', '<p class="name">' + serializedMessage.merge_vars.FNAME + "</p> <p> signed up for " + serializedMessage.merge_vars.CAMPAIGN_TITLE + "!</p>");
          break;
        case "campaign_reportback":
          main.sendActivityMessage('report back', '<p class="name">' + serializedMessage.merge_vars.FNAME + " </p> <p> reported back for " + serializedMessage.merge_vars.CAMPAIGN_TITLE + "!</p>");
          main.sendActivityMessage('report back image', serializedMessage.merge_vars.REPORTBACK_IMAGE_MARKUP);
          break;
        case "campaign_group_signup":
          break;
        case "user_password":
          break;
        default:
          break;
      }
    });

  });
});
{'fraction_non_alphanumeric': 0.13501742160278746, 'fraction_numerical': 0.0, 'mean_word_length': 3.5029411764705882, 'pattern_counts': {'":': 8, '<': 29, '<?xml version=': 0, '>': 29, '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': '5915231', 'n_tokens_mistral': 1394, 'n_tokens_neox': 1369, 'n_words': 298}