<commit_before>#!/usr/bin/env deno

const decoder = new TextDecoder("utf-8");

const buildEndpoint = async function buildEndpoint() {
  const [secret] = Deno.args;
  const stdinBuf = await Deno.readAll(Deno.stdin);
  const [url, star] = decoder.decode(stdinBuf).split("***");
  const encodedUrl = encodeURIComponent(url);
  let endpoint =
    `https://alec-reads.glitch.me/read?secret=${secret}&url=${encodedUrl}`;
  if (star) {
    endpoint += "&star=%20";
    if (star !== "nocomment") {
      endpoint += star;
    }<commit_msg>Encode a URI component<commit_after>#!/usr/bin/env deno

const decoder = new TextDecoder("utf-8");

const buildEndpoint = async function buildEndpoint() {
  const [secret] = Deno.args;
  const stdinBuf = await Deno.readAll(Deno.stdin);
  const [url, star] = decoder.decode(stdinBuf).split("***");
  const encodedUrl = encodeURIComponent(url);
  let endpoint =
    `https://alec-reads.glitch.me/read?secret=${secret}&url=${encodedUrl}`;
  if (star) {
    endpoint += "&star=%20";
    if (star !== "nocomment") {
      endpoint += encodeURIComponent(star);
    }
{'fraction_non_alphanumeric': 0.17415215398716774, 'fraction_numerical': 0.005499541704857928, 'mean_word_length': 4.300970873786408, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '5652206', 'n_tokens_mistral': 372, 'n_tokens_neox': 368, 'n_words': 77}