<commit_before>require 'figlet'
require 'dotenv'
require 'slack-ruby-client'

Dotenv.load

class Application < Sinatra::Base
  get '/' do
    @word = params['word'] || 'hi'
    @positive = params['positive'] || 'black_square'
    @negative = params['negative'] || 'white_square'

    @output = render_text @word, @positive, @negative

    erb :index
  end

  post '/' do
    client = Slack::Web::Client.new(token: ENV['SLACK_API_TOKEN'])

    channel = params[:channel_name]

    puts "CHANNEL: #{channel}"

    args = params[:text].split(" ")

    output = render_text args[0], args[1], args[2]

    options = {
      channel: channel,
      text: output,
      username: "Artsy",
      icon_url: "https://www.artsy.net/images/icon-150.png"
    }

    client.chat_postMessage options<commit_msg>does not compute<commit_after>require 'figlet'
require 'dotenv'
require 'slack-ruby-client'

Dotenv.load

class Application < Sinatra::Base
  get '/' do
    @word = params['word'] || 'hi'
    @positive = params['positive'] || 'black_square'
    @negative = params['negative'] || 'white_square'

    @output = render_text @word, @positive, @negative

    erb :index
  end

  post '/' do

    channel = params[:channel_name]
    args = params[:text].split(" ")

    puts "CHANNEL: #{channel}"

    client = Slack::Web::Client.new(token: ENV['SLACK_API_TOKEN'])

    output = render_text args[0], args[1], args[2]

    options = {
      channel: channel,
      text: output,
      username: "Artsy",
      icon_url: "https://www.artsy.net/images/icon-150.png"
    }

    client.chat_postMessage options
{'fraction_non_alphanumeric': 0.1554858934169279, 'fraction_numerical': 0.007523510971786834, 'mean_word_length': 3.3252032520325203, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, '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': '4842188', 'n_tokens_mistral': 553, 'n_tokens_neox': 524, 'n_words': 115}