<commit_before>require_relative 'creds.rb'
require 'watir-webdriver'

b = Watir::Browser.new

b.goto 'http://football.fantasysports.yahoo.com/pickem'

login_link = b.link :id => 'yucs-login_signIn'
login_link.click

b.text_field( :id => 'username').set($username)
b.text_field( :id => 'passwd').set($password)

b.button( :id => '.save').click

b.link(:text => 'Make your picks').when_present.click

radios = b.radios

radios.each do | r |
  b.radios(:name => r.name).to_a.sample.set
  next
end

tiebreaker_scores = b.text_fields(:id => /tiebreak/).each do |t|
  scores = (2..50).to_a.insert(0,0)
  score = scores.sample
  t.set(score.to_s)
end

tb_tmp = b.select_list(:id => 'tb_tmp')
tb_tmp.select tb_tmp.options.to_a.sample.text

tb_tlp = b.select_list(:id => 'tb_tlp')
tb_tlp.select tb_tlp.options.to_a.sample.text

#b.link(:text => 'Save Picks').click



<commit_msg>Added check for disabled radio button (if entering picks late and Thurs game has already been played)<commit_after>require_relative 'creds.rb'
require 'watir-webdriver'

b = Watir::Browser.new

b.goto 'http://football.fantasysports.yahoo.com/pickem'

login_link = b.link :id => 'yucs-login_signIn'
login_link.click

b.text_field( :id => 'username').set($username)
b.text_field( :id => 'passwd').set($password)

b.button( :id => '.save').click

b.link(:text => 'Make your picks').when_present.click

radios = b.radios

radios.each do | r |
  next unless r.enabled?
  b.radios(:name => r.name).to_a.sample.set
  next
end

tiebreaker_scores = b.text_fields(:id => /tiebreak/).each do |t|
  scores = (2..50).to_a.insert(0,0)
  score = scores.sample
  t.set(score.to_s)
end

tb_tmp = b.select_list(:id => 'tb_tmp')
tb_tmp.select tb_tmp.options.to_a.sample.text

tb_tlp = b.select_list(:id => 'tb_tlp')
tb_tlp.select tb_tlp.options.to_a.sample.text

#b.link(:text => 'Save Picks').click




{'fraction_non_alphanumeric': 0.17142857142857143, 'fraction_numerical': 0.005390835579514825, 'mean_word_length': 4.442815249266862, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 23, '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': '4247115', 'n_tokens_mistral': 768, 'n_tokens_neox': 743, 'n_words': 137}