<commit_before>const fetch = require('node-fetch');
const URL = require('url');

const ORIGIN = '172.16.31.10';

function analyzeSpeedKit(urlToTest) {
  const url = {
    protocol: 'http',
    host: ORIGIN,
    pathname: '/config',
    search: `url=${encodeURIComponent(urlToTest)}`,
  };

  const urlString = URL.format(url);
  return fetch(urlString)
    .then((res) => {
      if (res.status === 404) {
        throw new Error(`Not a valid Speed Kit URL: ${urlString}`);
      }

      return res.json();
    });
}

exports.analyzeSpeedKit = analyzeSpeedKit;<commit_msg>Change host used for analyzeSpeedKit code<commit_after>const fetch = require('node-fetch');
const URL = require('url');
const credentials = require('./credentials');

const ORIGIN = credentials.makefast_ip;

function analyzeSpeedKit(urlToTest) {
  const url = {
    protocol: 'http',
    host: ORIGIN,
    pathname: '/config',
    search: `url=${encodeURIComponent(urlToTest)}`,
  };

  const urlString = URL.format(url);
  return fetch(urlString)
    .then((res) => {
      if (res.status === 404) {
        throw new Error(`Not a valid Speed Kit URL: ${urlString}`);
      }

      return res.json();
    });
}

exports.analyzeSpeedKit = analyzeSpeedKit;
{'fraction_non_alphanumeric': 0.15459723352318958, 'fraction_numerical': 0.012205044751830757, 'mean_word_length': 3.5220588235294117, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 1, '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': '86803', 'n_tokens_mistral': 404, 'n_tokens_neox': 393, 'n_words': 93}