danhodge / picks

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

picks

Usage

nohup bundle exec foreman start&

Add a Migration

bundle exec rake db:create_migration NAME=create_table

Migrate the production DB

RACK_ENV=production bundle exec rake db:migrate

Setup (run these tasks in the following order)

Load the CBS sports schedule for the current season into the DB

Load the Family Fun schedule for the current season into the DB

bundle exec rake scrape:family_fun_schedule
bundle exec rake scrape:schedule

Load the CBS sports point spreads for the current season into the DB

bundle exec rake scrape:cbs_lines

Generate Blank Picks CSV

bundle exec rake picks:generate_csv

Generate Picks CSV with Choices

bundle exec rake "picks:generate_choices[randomness_score]"

Create User

bundle exec rake "user:create[<email>,<name>,<nickname>,<phone_number>]"

Submit Picks

bundle exec rake "picks:generate_and_submit[<csv_path>,<tie_breaker>,<nickname>,<password>]"

Deploy

  1. Copy prod db
  2. Re-run 1-3 with RACK_ENV=production

Export the participants

# re-run this after the games start to download all of the participants into the DB
bundle exec rake scrape:family_fun_schedule

# run this to export the participants JSON to S3
AWS_ACCESS_KEY_ID=<> AWS_SECRET_ACCESS_KEY=<> bundle exec rake scrape:export_participants[year]

Update the scores

AWS_ACCESS_KEY_ID=<> AWS_SECRET_ACCESS_KEY=<> bundle exec rake scrape:update_scores[year]

Update the seasons

AWS_PROFILE=<> bundle exec rake scrape:update_seasons

sqlite

# how to exit the sqlite3 CLI gracefully
sqlite> .quit

# how to make a copy of the existing DB
sqlite> .backup main backup.sqlite

About


Languages

Language:HTML 45.2%Language:Ruby 40.2%Language:TypeScript 12.2%Language:CSS 1.2%Language:JavaScript 1.1%Language:Procfile 0.0%