<commit_before># app.rb
require 'sinatra'
require 'dotenv'
require 'slack'
require 'json'
require 'httparty'
require 'pp'

Dotenv.load

class WhoIs < Sinatra::Base

  post '/' do
    content_type :json

    Slack.configure do |config|
      config.token = ENV['SLACK_API_TOKEN']
    end

    client = Slack::Client.new

    subject = params[:text]
    user = params[:user_name]

    client.users_list['members'].each do |user|
      if user["name"] == subject
        response = HTTParty.get("#{ENV['TEAM_NAV_API']}member?=#{user['profile']['email']}")
        puts "#{ENV['TEAM_NAV_API']}member?=#{user['profile']['email']}"
        puts response.body
        response.body.to_json
      end
    end
  end

end<commit_msg>post to slack with users name<commit_after># app.rb
require 'sinatra'
require 'dotenv'
require 'slack'
require 'json'
require 'httparty'
require 'pp'

Dotenv.load

class WhoIs < Sinatra::Base

  post '/' do
    content_type :json

    Slack.configure do |config|
      config.token = ENV['SLACK_API_TOKEN']
    end

    client = Slack::Client.new

    subject = params[:text]
    user = params[:user_name]

    client.users_list['members'].each do |user|
      if user["name"] == subject
        response = HTTParty.get("#{ENV['TEAM_NAV_API']}member?=#{user['profile']['email']}")
        puts "#{ENV['TEAM_NAV_API']}member?=#{user['profile']['email']}"
        puts response.body
        response.body.to_json

        client.chat_postMessage channel: '@christina', text: "#{JSON.parse(response.body)['name']}"

      end
    end
  end

end
{'fraction_non_alphanumeric': 0.1547314578005115, 'fraction_numerical': 0.0, 'mean_word_length': 3.446022727272727, 'pattern_counts': {'":': 0, '<': 5, '<?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': '3323239', 'n_tokens_mistral': 536, 'n_tokens_neox': 529, 'n_words': 111}