<commit_before>
/**
 * Dependencies.
 */

var exec = require('child_process').exec;
var request = require('superagent');
var fs = require('fs');

/**
 * Login to a LinkedIn account.
 *
 * @param {String} email
 * @param {String} password
 */

var login = exports.login = function(email, password){
  return function(nightmare) {
    nightmare
      .viewport(800, 1600)
      .goto('https://www.linkedin.com/uas/login')
      .type('#session_key-login', email)
      .type('#session_password-login', password)
      .click('#btn-primary')
      .wait(5000);
  };
};

/**
 * Perform a search.
 *
 * @param {String} type
 * @param {String} query
 */

var search = exports.search = function(type, query) {
  if (!type || type.length === 0) type = 'all';
  return function(nightmare) {
    nightmare
      .exists('#main-search-box', function(ready) {
        if (!ready) throw 'Search box not ready';
        return;
      })
      .type('#main-search-box', query)
      .click('.search-button')
      .wait('#search-types')
      .click('li > a[href*="' + type + '"]')
      .wait(5000);
  }
};

/**
 * Filter search results.
 *
 * @param {Array} filter, ['United States']
 */

var filter = exports.filter = function(filters) {
  return function(nightmare) {
    nightmare
      .exists('.search-results', function(ready) {
        if (!ready) throw 'Search results not ready';
        return;
      });
    filters.forEach(function(filter) {
      nightmare
        .click('label[title="' + filter + '"]')
        .wait(1000);
    });
  }
};

/**
 * Crawl X pages from search results.
 *
 * @param {Integer} pages leave blank for indefinite crawling.
 */

var crawl = exports.crawl = function(pages) {
  return function(nightmare) {
    // WIP
  }
};
<commit_msg>changed from wait 5000 to search box<commit_after>
/**
 * Dependencies.
 */

var exec = require('child_process').exec;
var request = require('superagent');
var fs = require('fs');

/**
 * Login to a LinkedIn account.
 *
 * @param {String} email
 * @param {String} password
 */

var login = exports.login = function(email, password){
  return function(nightmare) {
    nightmare
      .viewport(800, 1600)
      .goto('https://www.linkedin.com/uas/login')
      .type('#session_key-login', email)
      .type('#session_password-login', password)
      .click('#btn-primary')
      .wait('#main-search-box');
  };
};

/**
 * Perform a search.
 *
 * @param {String} type
 * @param {String} query
 */

var search = exports.search = function(type, query) {
  if (!type || type.length === 0) type = 'all';
  return function(nightmare) {
    nightmare
      .exists('#main-search-box', function(ready) {
        if (!ready) throw 'Search box not ready';
        return;
      })
      .type('#main-search-box', query)
      .click('.search-button')
      .wait('#search-types')
      .click('li > a[href*="' + type + '"]')
      .wait(5000);
  }
};

/**
 * Filter search results.
 *
 * @param {Array} filter, ['United States']
 */

var filter = exports.filter = function(filters) {
  return function(nightmare) {
    nightmare
      .exists('.search-results', function(ready) {
        if (!ready) throw 'Search results not ready';
        return;
      });
    filters.forEach(function(filter) {
      nightmare
        .click('label[title="' + filter + '"]')
        .wait(1000);
    });
  }
};

/**
 * Crawl X pages from search results.
 *
 * @param {Integer} pages leave blank for indefinite crawling.
 */

var crawl = exports.crawl = function(pages) {
  return function(nightmare) {
    // WIP
  }
};

{'fraction_non_alphanumeric': 0.17495085650098288, 'fraction_numerical': 0.011232799775344004, 'mean_word_length': 2.737670514165792, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, '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': '1928009', 'n_tokens_mistral': 1164, 'n_tokens_neox': 1116, 'n_words': 268}