<commit_before>var express = require('express')
	, http = require('http')
	, _ = require('underscore')
	, passport = require('passport')
	, LinkedInStrategy = require('passport-linkedin').Strategy
	, GithubStrategy = require('passport-github').Strategy
	, Parse = require('parse').Parse
	, VerifyWithParse = require('../../lib')(Parse);

var app = express();

// configure Express
app.set('port', process.env.PORT || 3000);
app.set('views', __dirname + '/views');
app.set('view engine', 'ejs');
app.use(express.logger());
app.use(express.cookieParser());
app.use(express.bodyParser());
app.use(express.methodOverride());
app.use(express.session({ secret: 'keyboard cat' }));
// Initialize Passport!  Also use passport.session() middleware, to support
// persistent login sessions (recommended).
app.use(passport.initialize());
app.use(passport.session());
app.use(app.router);
app.use(express.static(__dirname + '/public'));

// Initialize Parse library
Parse.initialize(
	"Y<KEY>" // Application ID
	, "rcMPA5kMWR<KEY>" // REST API Key
	, "<KEY>" // Master Key
);
Parse.Cloud.useMasterKey();

// Passport session setup.
// We'll use VerifyWithParse serialize and deserialize functions
passport.serializeUser(VerifyWithParse.serializeUser);
passport.deserializeUser(VerifyWithParse.deserializeUser);

// Use the LinkedInStrategy within Passport.
// We'll use VerifyWithParse.verify callback function
var LINKEDIN_API_KEY = "<KEY>";
var LINKEDIN_SECRET_KEY = "uccR7kQanRDay40A";
passport.use(
	new LinkedInStrategy({
		consumerKey: LINKEDIN_API_KEY
		, consumerSecret: LINKEDIN_SECRET_KEY
		, callbackURL: "http://127.0.0.1:3000/auth/linkedin/callback"
		, profileFields: ['id', 'first-name', 'last-name', 'email-address', 'headline', 'picture-url']
		, passReqToCallback: true
		}
	/*
	* VerifyWithParse
	*/
	, VerifyWithParse.verify()
));

// Use the GithubStrategy within Passport.
// We'll use VerifyWithParse.verify callback function
var GITHUB_API_KEY = "<KEY>";
var GITHUB_SECRET_KEY = "<KEY>";
passport.use(
	new GithubStrategy({
		clientID: GITHUB_API_KEY
		, clientSecret: GITHUB_SECRET_KEY
		, callbackURL: "http://127.0.0.1:3000/auth/github/callback"
		, passReqToCallback: true
		}
	/*
	* VerifyWithParse
	*/
	, VerifyWithParse.verify()
));

app.get('/', function(req, res){
  res.render('index', { user: req.user });
});

app.get('/account', ensureAuthenticated
, function(req, res, next){
	req.user.relation("accounts").query().find()
	.then(function(results){
		req.accounts = results;
		next();
	});
}
, function(req, res){
	var accounts = {};
	_.each(req.accounts, function(account){
		accounts[account.get("provider")] = account.toJSON();<commit_msg>improved readme<commit_after>var express = require('express')
	, http = require('http')
	, _ = require('underscore')
	, passport = require('passport')
	, LinkedInStrategy = require('passport-linkedin').Strategy
	, GithubStrategy = require('passport-github').Strategy
	, Parse = require('parse').Parse
	, VerifyWithParse = require('../../lib')(Parse);

var app = express();

// configure Express
app.set('port', process.env.PORT || 3000);
app.set('views', __dirname + '/views');
app.set('view engine', 'ejs');
app.use(express.logger());
app.use(express.cookieParser());
app.use(express.bodyParser());
app.use(express.methodOverride());
app.use(express.session({ secret: 'keyboard cat' }));
// Initialize Passport!  Also use passport.session() middleware, to support
// persistent login sessions (recommended).
app.use(passport.initialize());
app.use(passport.session());
app.use(app.router);
app.use(express.static(__dirname + '/public'));

// Initialize Parse library
Parse.initialize(
	"<KEY>" // Application ID
	, "<KEY>" // REST API Key
	, "<KEY>" // Master Key
);
Parse.Cloud.useMasterKey();

// Passport session setup.
// We'll use VerifyWithParse serialize and deserialize functions
passport.serializeUser(VerifyWithParse.serializeUser);
passport.deserializeUser(VerifyWithParse.deserializeUser);

// Use the LinkedInStrategy within Passport.
// We'll use VerifyWithParse.verify callback function

passport.use(
	new LinkedInStrategy({
		consumerKey: LINKEDIN_API_KEY
		, consumerSecret: LINKEDIN_SECRET_KEY
		, callbackURL: "http://127.0.0.1:3000/auth/linkedin/callback"
		, profileFields: ['id', 'first-name', 'last-name', 'email-address', 'headline', 'picture-url']
		, passReqToCallback: true
		}
	/*
	* VerifyWithParse
	*/
	, VerifyWithParse.verify()
));

// Use the GithubStrategy within Passport.
// We'll use VerifyWithParse.verify callback function

passport.use(
	new GithubStrategy({
		clientID: GITHUB_API_KEY
		, clientSecret: GITHUB_SECRET_KEY
		, callbackURL: "http://127.0.0.1:3000/auth/github/callback"
		, passReqToCallback: true
		}
	/*
	* VerifyWithParse
	*/
	, VerifyWithParse.verify()
));

app.get('/', function(req, res){
  res.render('index', { user: req.user });
});

app.get('/account', ensureAuthenticated
, function(req, res, next){
	req.user.relation("accounts").query().find()
	.then(function(results){
		req.accounts = results;
		next();
	});
}
, function(req, res){
	var accounts = {};
	_.each(req.accounts, function(account){
		accounts[account.get("provider")] = account.toJSON();
{'fraction_non_alphanumeric': 0.1707787201233616, 'fraction_numerical': 0.010023130300693909, 'mean_word_length': 5.192124105011933, 'pattern_counts': {'":': 0, '<': 12, '<?xml version=': 0, '>': 12, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 4, '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': '7197403', 'n_tokens_mistral': 1760, 'n_tokens_neox': 1703, 'n_words': 330}