<commit_before>require 'sinatra'

class App < Sinatra::Base
  
  configure do
    set :lastFetchedDay, nil
    set :lastFetchedString, nil
  end

  get '/' do
    # @js = "index.js"
    # erb :index
    erb :hardcode
  end
  
  get '/reason' do
    require './lib/wikicrawl.rb'
    d = Time.now.strftime("%B %-d")
    
    # some days are hardcoded
    hardcoded = {"February 9" => "National Pizza Day",
                 "July 10" => "Pizza Day in Brazil",
                 "September 5" => "National Cheese Pizza Day",
                 "September 20" => "National Pepperoni Pizza Day",
                 "October 11" => "National Sausage Pizza Day",
                 "November 10" => "the First Day of Pizzamas",
                 "November 11" => "the Second Day of Pizzamas",
                 "November 12" => "National Pizza with the Works Except Anchovies Day, and the Third Day of Pizzamas",
                 "November 13" => "the Fourth Day of Pizzamas",
                 "November 14" => "the Fifth Day of Pizzamas",
                 "November 15" => "the Sixth Day of Pizzamas",
                 "November 16" => "the Seventh Day of Pizzamas",
                 "November 17" => "the Eighth Day of Pizzamas",
                 "November 18" => "the Ninth Day of Pizzamas",
                 "November 19" => "the Tenth Day of Pizzamas",
                 "November 20" => "the Eleventh Day of Pizzamas",
                 "November 21" => "the Twelfth Day of Pizzamas"}
    if (hardcoded.keys.index(d) != nil)
      reason = "today is #{hardcoded[d]}"
    else<commit_msg>disable hardcode. should've put it in an if anyway<commit_after>require 'sinatra'

class App < Sinatra::Base
  
  configure do
    set :lastFetchedDay, nil
    set :lastFetchedString, nil
  end

  get '/' do
    @js = "index.js"
    erb :index
    # erb :hardcode
  end
  
  get '/reason' do
    require './lib/wikicrawl.rb'
    d = Time.now.strftime("%B %-d")
    
    # some days are hardcoded
    hardcoded = {"February 9" => "National Pizza Day",
                 "July 10" => "Pizza Day in Brazil",
                 "September 5" => "National Cheese Pizza Day",
                 "September 20" => "National Pepperoni Pizza Day",
                 "October 11" => "National Sausage Pizza Day",
                 "November 10" => "the First Day of Pizzamas",
                 "November 11" => "the Second Day of Pizzamas",
                 "November 12" => "National Pizza with the Works Except Anchovies Day, and the Third Day of Pizzamas",
                 "November 13" => "the Fourth Day of Pizzamas",
                 "November 14" => "the Fifth Day of Pizzamas",
                 "November 15" => "the Sixth Day of Pizzamas",
                 "November 16" => "the Seventh Day of Pizzamas",
                 "November 17" => "the Eighth Day of Pizzamas",
                 "November 18" => "the Ninth Day of Pizzamas",
                 "November 19" => "the Tenth Day of Pizzamas",
                 "November 20" => "the Eleventh Day of Pizzamas",
                 "November 21" => "the Twelfth Day of Pizzamas"}
    if (hardcoded.keys.index(d) != nil)
      reason = "today is #{hardcoded[d]}"
    else
{'fraction_non_alphanumeric': 0.11467169337103361, 'fraction_numerical': 0.020106817467797675, 'mean_word_length': 1.876242095754291, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 37, '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': '6547742', 'n_tokens_mistral': 1048, 'n_tokens_neox': 898, 'n_words': 339}