<commit_before>const request = require('request')
const async = require('async')
const cheerio = require('cheerio')

function getInfo (params, callback) {
  const url = `http://nummar.fo/?s=${params}`
  console.log(url)
  request(url, (error, response, body) => {
    if (!error) {
      if (response.statusCode === 200) {
        callback(null, body)
      } else {
        const errorMsg = `Invalid status code: ${response.statusCode}`
        callback(errorMsg)
      }
    } else {
      callback(error)
    }
  })
}

function getResults (body, callback) {
  const htmlResults = []
  const results = []
  let $ = cheerio.load(body)
  $('.mdCardPerson').each(function () {
    htmlResults.push({ html: $(this).html() })
  })
  htmlResults.forEach((r) => {
    const newResult = {}
    let $ = cheerio.load(r.html)
    newResult.name = $('.fn').text()
    newResult.streetAddress = $('.street-address').text()
    newResult.postalCode = $('.postal-code').text()
    newResult.locality = $('.locality').text()
    newResult.region = $('.region*').text()

    results.push(newResult)
  })
  callback(null, results)<commit_msg>Forgot to add phone number.. doh!<commit_after>const request = require('request')
const async = require('async')
const cheerio = require('cheerio')

function getInfo (params, callback) {
  const url = `http://nummar.fo/?s=${params}`
  request(url, (error, response, body) => {
    if (!error) {
      if (response.statusCode === 200) {
        callback(null, body)
      } else {
        const errorMsg = `Invalid status code: ${response.statusCode}`
        callback(errorMsg)
      }
    } else {
      callback(error)
    }
  })
}

function getResults (body, callback) {
  const htmlResults = []
  const results = []
  let $ = cheerio.load(body)
  $('.mdCardPerson').each(function () {
    htmlResults.push($(this).html())
  })
  htmlResults.forEach((r) => {
    const newResult = {}
    let $ = cheerio.load(r)
    newResult.name = $('.fn').text()
    newResult.streetAddress = $('.street-address').text()
    newResult.postalCode = $('.postal-code').text()
    newResult.locality = $('.locality').text()
    newResult.region = $('.region*').text()
    newResult.numbers = {}
    $('.tel').each(function (i, e) {
      let $ = cheerio.load(e)
      const type = $('.type').text()
      if (type === 'Fartelefon') {
        newResult.numbers.mobile = $('.value').text()
      } else if (type === 'Fastnet') {
        newResult.numbers.fastnet = $('.value').text()
      }
    })

    results.push(newResult)
  })
  callback(null, results)
{'fraction_non_alphanumeric': 0.18659914296844565, 'fraction_numerical': 0.002337358784573432, 'mean_word_length': 3.0062402496099843, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '3409974', 'n_tokens_mistral': 841, 'n_tokens_neox': 811, 'n_words': 161}