<commit_before>let hnDuplicateChecker = (function(){
  let input = document.querySelector( 'input[name=url]' ),
    elem = document.createElement( 'a' ),
    yearAgo = Math.floor( Date.now() / 1000 ) - 31540000,
    request;

  input.addEventListener( 'blur', getDuplicates );

  function getDuplicates(){
    elem.href = input.value;
    let host = elem.host,
      path = elem.pathname;
    if ( document.hasFocus() && host !== document.location.host ){
      request = new XMLHttpRequest();
      request.open( 'GET', `https://hn.algolia.com/api/v1/search_by_date?query=${host}${path}&restrictSearchableAttributes=url&tags=(story,show_hn)&numericFilters=created_at_i>${yearAgo}` );
      request.onreadystatechange = processDuplicates;
      request.send();
    }
  };

  function processDuplicates(){
    if ( request.readyState === XMLHttpRequest.DONE && request.status === 200 ){
      let prevDupes = document.getElementById( 'duplicates' ),
        response = JSON.parse( request.responseText ),
        tr = document.createElement( 'tr' ),<commit_msg>Add TODO<commit_after>let hnDuplicateChecker = (function(){
  let input = document.querySelector( 'input[name=url]' ),
    elem = document.createElement( 'a' ),
    yearAgo = Math.floor( Date.now() / 1000 ) - 31540000,
    request;

  input.addEventListener( 'blur', getDuplicates );

  function getDuplicates(){
    elem.href = input.value;
    let host = elem.host, // TODO: Modify this such that host will not be empty with bare domains
      path = elem.pathname;
    if ( document.hasFocus() && host !== document.location.host ){
      request = new XMLHttpRequest();
      request.open( 'GET', `https://hn.algolia.com/api/v1/search_by_date?query=${host}${path}&restrictSearchableAttributes=url&tags=(story,show_hn)&numericFilters=created_at_i>${yearAgo}` );
      request.onreadystatechange = processDuplicates;
      request.send();
    }
  };

  function processDuplicates(){
    if ( request.readyState === XMLHttpRequest.DONE && request.status === 200 ){
      let prevDupes = document.getElementById( 'duplicates' ),
        response = JSON.parse( request.responseText ),
        tr = document.createElement( 'tr' ),
{'fraction_non_alphanumeric': 0.14586191129401005, 'fraction_numerical': 0.014631915866483767, 'mean_word_length': 3.8193832599118944, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 2, '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': '3788165', 'n_tokens_mistral': 690, 'n_tokens_neox': 659, 'n_words': 130}