<commit_before>"use strict";
module.exports = function (app){

	var globals = require("./globals");
	var sender = require("./sendThings");
	var messageHandler = require("./messagingEventHandler");

	app.get("/", function(req, res){
		res.send("hello there!");
	});

	app.get("/test", function(req, res){
		sender.sendTextMessage("1347063515338436", "TEST TEST TEST!!!!");
		res.send("I got your test: " + process.env.VALIDATION_TOKEN + process.env.PAGE_ACCESS_TOKEN);
	});

	app.get("/webhook", function(req, res){
		console.log("GET at webhook");
		if (req.query["hub.mode"] === "subscribe" && 
			req.query["hub.verify_token"] == process.env.VALIDATION_TOKEN){

				console.log("validating webhook");
				res.status(200).send(req.query["hub.challenge"]);
			} else{
				console.log("failed validation. validation tokens don't match");
				res.sendStatus(403);
			}
	});

	app.post("/webhook", function(req, res){
		console.log("POST at webhook");
		var data = req.body;

		sender.sendTextMessage("1347063515338436", "TEST TEST TEST!!!!");
		console.log(data);

		if(data.object === "page"){
			data.entry.forEach(function(pageEntry) {

				var pageID = pageEntry.id;
			  var timeOfEvent = pageEntry.time;

				pageEntry.messaging.forEach(function (messagingEvent){
					if (messagingEvent.optin) {
						console.log("got option event");
						messageHandler.receivedAuthentication(messagingEvent);
<commit_msg>nice nice nice<commit_after>"use strict";
module.exports = function (app){

	var globals = require("./globals");
	var sender = require("./sendThings");
	var messageHandler = require("./messagingEventHandler");

	app.get("/", function(req, res){
		res.send("hello there!");
	});

	app.get("/test", function(req, res){
		sender.sendTextMessage("1347063515338436", "TEST TEST TEST!!!!");
		res.send("I got your test: " + process.env.VALIDATION_TOKEN + process.env.PAGE_ACCESS_TOKEN);
	});

	app.get("/webhook", function(req, res){
		console.log("GET at webhook");
		if (req.query["hub.mode"] === "subscribe" && 
			req.query["hub.verify_token"] == process.env.VALIDATION_TOKEN){

				console.log("validating webhook");
				res.status(200).send(req.query["hub.challenge"]);
			} else{
				console.log("failed validation. validation tokens don't match");
				res.sendStatus(403);
			}
	});

	app.post("/webhook", function(req, res){
		console.log("POST at webhook");
		var data = req.body;

		if(data.object === "page"){
			data.entry.forEach(function(pageEntry) {

				var pageID = pageEntry.id;
			  var timeOfEvent = pageEntry.time;

				pageEntry.messaging.forEach(function (messagingEvent){
					if (messagingEvent.optin) {
						console.log("got option event");
						messageHandler.receivedAuthentication(messagingEvent);

{'fraction_non_alphanumeric': 0.17647058823529413, 'fraction_numerical': 0.021921812203142127, 'mean_word_length': 4.443339960238569, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '2834293', 'n_tokens_mistral': 1047, 'n_tokens_neox': 874, 'n_words': 167}