<commit_before>desc "This task is called by the Heroku scheduler add-on"

require "#{Rails.root}/app/helpers/payments_tracker_helper"
require "#{Rails.root}/app/helpers/teamsnap_helper"
include PaymentsTrackerHelper
include TeamsnapHelper

#rake run_payment_sync 
task :run_payment_sync => :environment do
  puts "Updating payments..."
  sync_payment_data
  puts "Payments Synced."
end

#rake send_division_emails
task :run_payment_send_division_emails => :environment do
  puts "Updating payments..."
  #sync_payment_data
  puts "Payments Synced."

  # if today is Wednesday or Friday send out the email with the division rosters
  today = Time.now.utc.wday
  # sunday    = 1 
  # monday    = 2
  # tuesday   = 3
  # wednesday = 4
  # thursday  = 5
  # Friday    = 6
  # Saturday  = 7
  # Sunday    = 8
  # 
  # Only send out the emails for payments on Monday and Friday
  if today == 2 || today == 6
    puts 'Sending out the Email Updates for Rosters'
    account = TeamsnapScanAccount.order('created_at DESC').first
    loginHash = log_in_to_teamsnap(account.username,account.password, false)
    if (loginHash[:teamsnapToken])
      divisions = teamsnap_divs_by_id
      divisions.each do |key, value|
        if value == 16139
          break
        end
        puts "Sending Roster Email For: #{key}"
        send_web_team_roster_email(value,key,loginHash[:teamsnapToken])
      end
    else
      puts "ERROR: Teamsnap Login Failed, no emails sent"
    end
  end
end<commit_msg>Send test out on tuesday<commit_after>desc "This task is called by the Heroku scheduler add-on"

require "#{Rails.root}/app/helpers/payments_tracker_helper"
require "#{Rails.root}/app/helpers/teamsnap_helper"
include PaymentsTrackerHelper
include TeamsnapHelper

#rake run_payment_sync 
task :run_payment_sync => :environment do
  puts "Updating payments..."
  sync_payment_data
  puts "Payments Synced."
end

#rake send_division_emails
task :run_payment_send_division_emails => :environment do
  puts "Updating payments..."
  #sync_payment_data
  puts "Payments Synced."

  # if today is Wednesday or Friday send out the email with the division rosters
  today = Time.now.utc.wday
  # sunday    = 1 
  # monday    = 2
  # tuesday   = 3
  # wednesday = 4
  # thursday  = 5
  # Friday    = 6
  # Saturday  = 7
  # Sunday    = 8
  # 
  # Only send out the emails for payments on Monday and Friday
  if today == 3 || today == 6
    puts 'Sending out the Email Updates for Rosters'
    account = TeamsnapScanAccount.order('created_at DESC').first
    loginHash = log_in_to_teamsnap(account.username,account.password, false)
    if (loginHash[:teamsnapToken])
      divisions = teamsnap_divs_by_id
      divisions.each do |key, value|
        if value == 16139
          break
        end
        puts "Sending Roster Email For: #{key}"
        send_web_team_roster_email(value,key,loginHash[:teamsnapToken])
      end
    else
      puts "ERROR: Teamsnap Login Failed, no emails sent"
    end
  end
end
{'fraction_non_alphanumeric': 0.08375209380234507, 'fraction_numerical': 0.010050251256281407, 'mean_word_length': 3.284074605451937, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '1040213', 'n_tokens_mistral': 1008, 'n_tokens_neox': 967, 'n_words': 283}