<commit_before>package app.restlike.common

object Script {
  def install(app: String) =
    (s"""#!/bin/bash
      |#INSTALLATION:
      |#- alias $app='{path to}/$app.sh'
      |#- that's it!
      |
      |HOST="http://${java.net.InetAddress.getLocalHost.getHostName}:8473"
      |""" + """OPTIONS="--timeout=15 --no-proxy -qO-"
      |WHO=`id -u -n`
      |BASE="""" + app + """/$WHO"
      |REQUEST="$OPTIONS HOST/$BASE"
      |MESSAGE="${@:1}"
      |RESPONSE=`wget $REQUEST --tries=1 --post-data="{\"value\":\"${MESSAGE}\"}" --header=Content-Type:application/json`
      |echo
      |if [ $? -ne 0 ]; then
      |  echo "sorry, """ + app + """ seems to be unavailable right now, please try again later"
      |else
      |  echo "$RESPONSE"
      |fi
      |echo
      |`wget -qO.""" + app + """.bak $HOST/""" + app + """/state`
      |
    """).stripMargin.split("\n").toList
}
<commit_msg>fix the script<commit_after>package app.restlike.common

object Script {
  def install(app: String) =
    (s"""#!/bin/bash
      |#INSTALLATION:
      |#- alias $app='{path to}/$app.sh'
      |#- that's it!
      |
      |HOST="http://${java.net.InetAddress.getLocalHost.getHostName}:8473"
      |""" + """OPTIONS="--timeout=15 --no-proxy -qO-"
      |WHO=`id -u -n`
      |BASE="""" + app + """/$WHO"
      |REQUEST="$OPTIONS $HOST/$BASE"
      |MESSAGE="${@:1}"
      |RESPONSE=`wget $REQUEST --tries=1 --post-data="{\"value\":\"${MESSAGE}\"}" --header=Content-Type:application/json`
      |echo
      |if [ $? -ne 0 ]; then
      |  echo "sorry, """ + app + """ seems to be unavailable right now, please try again later"
      |else
      |  echo "$RESPONSE"
      |fi
      |echo
      |`wget -qO.""" + app + """.bak $HOST/""" + app + """/state`
      |
    """).stripMargin.split("\n").toList
}

{'fraction_non_alphanumeric': 0.23414905450500556, 'fraction_numerical': 0.010011123470522803, 'mean_word_length': 2.3376623376623376, 'pattern_counts': {'":': 2, '<': 3, '<?xml version=': 0, '>': 3, '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': '5209434', 'n_tokens_mistral': 681, 'n_tokens_neox': 654, 'n_words': 128}