<commit_before>/**
 * Scraper Application File
 */
'use strict';

var express = require('express');
var fs = require('fs');
var request = require('request');
var cheerio = require('cheerio');
var _ = require('lodash');
var app = express();
var FileCookieStore = require('tough-cookie-filestore');
// NOTE - currently the 'cookies.json' file must already exist!
var cookieStore = new FileCookieStore('data/cookies.json');

var j = request.jar(cookieStore);

request = request.defaults({
  jar: true,                 // save cookies to jar
  rejectUnauthorized: false, 
  followAllRedirects: true   // allow redirections
});
var urls = {
  orders: 'https://vendorexpress.amazon.com/orders'
};
// Assemble headers for requests
var headers = {'Cookie': ''};
fs.readFile('./data/cookieString.txt', function(err, data) {
  if (err) {
    console.log('CookieString.txt read error: ' + err + '\nMake sure the file exists')
  } else {
    headers.Cookie = data;
    // console.log('cookieStr contents: ' + headers.Cookie);
    request.get({url: urls.orders, headers: headers, jar: j}, scrapeOrders);
  }
})

var user = process.env.AVE_ACCOUNT;
var pass = process.env.AVE_ACCOUNT_PW;


// input ids:
// 'ap_email' 'ap_password'

<commit_msg>Push for switching dev environments.<commit_after>/**
 * Scraper Application File
 */
'use strict';

var express = require('express');
var fs = require('fs');
var request = require('request');
var cheerio = require('cheerio');
var _ = require('lodash');
var app = express();
var FileCookieStore = require('tough-cookie-filestore');
// NOTE - currently the 'cookies.json' file must already exist!
var cookieStore = new FileCookieStore('data/cookies.json');

var j = request.jar(cookieStore);

request = request.defaults({
  jar: true,                 // save cookies to jar
  rejectUnauthorized: false, 
  followAllRedirects: true   // allow redirections
});
var urls = {
  base: 'https://vendorexpress.amazon.com/',
  orders: 'https://vendorexpress.amazon.com/orders'
};

var suffixes = {
  orders: 'dfOrders'
}
// Assemble headers for requests
var headers = {'Cookie': ''};
fs.readFile('./data/cookieString.txt', function(err, data) {
  if (err) {
    console.log('CookieString.txt read error: ' + err + '\nMake sure the file exists')
  } else {
    headers.Cookie = data;
    // console.log('cookieStr contents: ' + headers.Cookie);
    request.get({url: urls.orders, headers: headers, jar: j}, scrapeOrders);
  }
})

var user = process.env.AVE_ACCOUNT;
var pass = <PASSWORD>.AVE_ACCOUNT_PW;


// input ids:
// 'ap_email' 'ap_password'


{'fraction_non_alphanumeric': 0.1556420233463035, 'fraction_numerical': 0.0, 'mean_word_length': 3.9442307692307694, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, 'https://': 3, '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': '1012449', 'n_tokens_mistral': 825, 'n_tokens_neox': 807, 'n_words': 216}