<commit_before>require 'sinatra'
require 'sinatra/partial'
require 'slack/client'
require 'rubygems'
require 'json'
require 'date'
require 'omniauth'
require 'omniauth-oauth2'
require 'omniauth/strategies/github'
require 'omniauth/strategies/slack'
require 'omniauth/strategies/oauth2'

set :partial_template_engine, :erb

require_relative 'models'

helpers do
 #saving for later
end

use Rack::Session::Cookie
use OmniAuth::Builder do
  provider :developer
  provider :slack, ENV['SLACK_ID'], ENV['SLACK_SECRET']
  provider :github, ENV['GITHUB_KEY'], ENV['GITHUB_SECRET']
end

get '/slack_oauth' do
  redirect 'http://localhost:4567/auth/slack/'
end

get '/auth/:provider/callback' do
  auth = request.env['omniauth.auth']
  puts @name
  puts "********* auth ********"
  puts auth<commit_msg>Adding live redirect<commit_after>require 'sinatra'
require 'sinatra/partial'
require 'slack/client'
require 'rubygems'
require 'json'
require 'date'
require 'omniauth'
require 'omniauth-oauth2'
require 'omniauth/strategies/github'
require 'omniauth/strategies/slack'
require 'omniauth/strategies/oauth2'

set :partial_template_engine, :erb

require_relative 'models'

helpers do
 #saving for later
end

use Rack::Session::Cookie
use OmniAuth::Builder do
  provider :developer
  provider :slack, ENV['SLACK_ID'], ENV['SLACK_SECRET']
  provider :github, ENV['GITHUB_KEY'], ENV['GITHUB_SECRET']
end

get '/slack_oauth' do
  #redirect 'http://localhost:4567/auth/slack/'
  redirect 'http://slacker-notes.herokuapp.com'
end

get '/auth/:provider/callback' do
  auth = request.env['omniauth.auth']
  puts @name
  puts "********* auth ********"
  puts auth
{'fraction_non_alphanumeric': 0.14416058394160583, 'fraction_numerical': 0.0072992700729927005, 'mean_word_length': 6.02991452991453, 'pattern_counts': {'":': 0, '<': 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': '7010747', 'n_tokens_mistral': 602, 'n_tokens_neox': 590, 'n_words': 135}