<commit_before>/* bookmarklet will inject a script that loads this page
** need a route in the server for the script tag url
*/

(function() {
  var d = document,
      l = d.location,
      t = window.getSelection,
      k = d.getSelection,
      x = d.selection,
      s = String(t ? t(): (k)? k(): (x ? x.createRange().text : '')),
      e = encodeURIComponent,
    req = new XMLHttpRequest(),
   data = JSON.stringify({
    uri: l.href,
    title: d.title,
    clipping: s
   });
  console.log("party");
<<<<<<< HEAD
  setTimeout(function(){
    console.log("time");
  }, 1500);
=======
>>>>>>> post request route
  req.open('POST', '//localhost:3000/uri', true);
  req.setRequestHeader('Content-Type', 'application/JSON');
  req.send(data);
})();<commit_msg>adjust header to allow requests<commit_after>/* bookmarklet will inject a script that loads this page
** need a route in the server for the script tag url
*/

(function() {
  var d = document,
      l = d.location,
      t = window.getSelection,
      k = d.getSelection,
      x = d.selection,
      s = String(t ? t(): (k)? k(): (x ? x.createRange().text : '')),
      e = encodeURIComponent,
    req = new XMLHttpRequest(),
   data = JSON.stringify({
    uri: l.href,
    title: d.title,
    clipping: s
   });
  console.log("party");
  setTimeout(function(){
    console.log("time");
  }, 1500);
  req.open('POST', '//localhost:3000/uri', true);
  req.setRequestHeader('Content-Type', 'application/JSON');
  req.send(data);
})();
{'fraction_non_alphanumeric': 0.18114973262032086, 'fraction_numerical': 0.0106951871657754, 'mean_word_length': 3.045945945945946, 'pattern_counts': {'":': 0, '<': 10, '<?xml version=': 0, '>': 10, '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': '4459602', 'n_tokens_mistral': 499, 'n_tokens_neox': 488, 'n_words': 134}