<commit_before>/*
Rushed ugly code by <<EMAIL>>

Will clean up and make available

*/
var MailChimpAPI = require('mailchimp').MailChimpAPI;
//
var apiKey = process.env.MAILCHIMP_API_KEY;

try { 
    var api = new MailChimpAPI(apiKey, { version : '2.0' });
} catch (error) {
    console.log(error.message);
}

var express = require('express');
var port = process.env.PORT || 8080;
var allowCrossDomain = function(req, res, next) {
  var allowedHost = [
    'http://2.stopwatching.us',
    'http://localhost:4000'
  ];
  if(allowedHost.indexOf(req.headers.origin) !== -1 ) {
    res.header('Access-Control-Allow-Credentials', true);
    res.header('Access-Control-Allow-Origin', req.headers.origin)
    res.header('Access-Control-Allow-Methods', 'GET,PUT,POST,DELETE,OPTIONS');
    res.header('Access-Control-Allow-Headers', 'X-CSRF-Token, X-Requested-With, Accept, Accept-Version, Content-Length, Content-MD5, Content-Type, Date, X-Api-Version');
    next();
  } else {
    res.send({auth: false});
  }
}

var server = express();
server.use(express.bodyParser());
server.use(allowCrossDomain);

server.options("*", function(req,res,next){res.send({});});

server.post('/subscribe', function(req,res,next){
    
    var email = req.body.email;<commit_msg>stop watching us<commit_after>/*
Rushed ugly code by <<EMAIL>>

Will clean up and make available

*/
var MailChimpAPI = require('mailchimp').MailChimpAPI;
//
var apiKey = process.env.MAILCHIMP_API_KEY;

try { 
    var api = new MailChimpAPI(apiKey, { version : '2.0' });
} catch (error) {
    console.log(error.message);
}

var express = require('express');
var port = process.env.PORT || 8080;
var allowCrossDomain = function(req, res, next) {
  var allowedHost = [
    'http://dev.stopwatching.us',
    'http://rally.stopwatching.us',
    'http://2.stopwatching.us',
    'http://localhost:4000'
  ];
  if(allowedHost.indexOf(req.headers.origin) !== -1 ) {
    res.header('Access-Control-Allow-Credentials', true);
    res.header('Access-Control-Allow-Origin', req.headers.origin)
    res.header('Access-Control-Allow-Methods', 'GET,PUT,POST,DELETE,OPTIONS');
    res.header('Access-Control-Allow-Headers', 'X-CSRF-Token, X-Requested-With, Accept, Accept-Version, Content-Length, Content-MD5, Content-Type, Date, X-Api-Version');
    next();
  } else {
    res.send({auth: false});
  }
}

var server = express();
server.use(express.bodyParser());
server.use(allowCrossDomain);

server.options("*", function(req,res,next){res.send({});});

server.post('/subscribe', function(req,res,next){
    
    var email = req.body.email;
{'fraction_non_alphanumeric': 0.18069018999612252, 'fraction_numerical': 0.010081426909654904, 'mean_word_length': 4.297741273100616, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '1001280', 'n_tokens_mistral': 886, 'n_tokens_neox': 874, 'n_words': 159}