Skip to content

Commit

Permalink
Download today's wellness data
Browse files Browse the repository at this point in the history
An update to allow for current day's (incomplete day) wellness data to be downloaded. Previously the download would end with yesterdays (complete) data
  • Loading branch information
pgalko committed Oct 16, 2022
1 parent ead2272 commit 1cac4a5
Show file tree
Hide file tree
Showing 7 changed files with 89 additions and 444 deletions.
4 changes: 3 additions & 1 deletion src/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,10 @@ RUN apt-get install -y wget
# Download and Install chrome
RUN wget -q https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
RUN apt-get install -y ./google-chrome-stable_current_amd64.deb
# Check chrome version
RUN echo "Chrome: " && google-chrome --version
# Download and Install chromedriver. The version here depends on what what version of chrome gets installed above !
RUN wget https://chromedriver.storage.googleapis.com/104.0.5112.79/chromedriver_linux64.zip
RUN wget https://chromedriver.storage.googleapis.com/105.0.5195.52/chromedriver_linux64.zip
RUN unzip chromedriver_linux64.zip
RUN mv chromedriver /usr/bin/chromedriver
RUN chown root:root /usr/bin/chromedriver
Expand Down
10 changes: 5 additions & 5 deletions src/athletedataapp_apache.py
Original file line number Diff line number Diff line change
Expand Up @@ -546,7 +546,7 @@ def index():
with StdoutRedirection(ath_un):
print(gc_fit_well_progress)
time.sleep(1)
gc.dwnld_insert_fit_wellness(ath_un, gc_agent,start_date,end_date,gc_username, gc_password, mfp_username, output, db_host, db_name, superuser_un,superuser_pw, archive_to_dropbox,archive_radio,dbx_auth_token,encr_pass)
gc.dwnld_insert_fit_wellness(ath_un, gc_agent,start_date,end_date_today,gc_username, gc_password, mfp_username, output, db_host, db_name, superuser_un,superuser_pw, archive_to_dropbox,archive_radio,dbx_auth_token,encr_pass)
gc_fit_well_progress = 'GC FIT wellness data downloaded successfully'
with StdoutRedirection(ath_un):
print(gc_fit_well_progress)
Expand All @@ -570,8 +570,8 @@ def index():
with StdoutRedirection(ath_un):
print(gc_json_well_progress)
time.sleep(1)
gc.dwnld_insert_json_wellness(ath_un, gc_agent, start_date, end_date, gc_username, gc_password, mfp_username, display_name, output, db_host, db_name, superuser_un,superuser_pw, archive_to_dropbox,archive_radio,dbx_auth_token,encr_pass)
gc.dwnld_insert_json_body_composition(ath_un, gc_agent, start_date, end_date, gc_username, gc_password, mfp_username, output, db_host, db_name, superuser_un,superuser_pw, archive_to_dropbox, archive_radio, dbx_auth_token,encr_pass)
gc.dwnld_insert_json_wellness(ath_un, gc_agent, start_date, end_date_today, gc_username, gc_password, mfp_username, display_name, output, db_host, db_name, superuser_un,superuser_pw, archive_to_dropbox,archive_radio,dbx_auth_token,encr_pass)
gc.dwnld_insert_json_body_composition(ath_un, gc_agent, start_date, end_date_today, gc_username, gc_password, mfp_username, output, db_host, db_name, superuser_un,superuser_pw, archive_to_dropbox, archive_radio, dbx_auth_token,encr_pass)
gc_json_well_progress = 'GC JSON wellness data downloaded successfully'
with StdoutRedirection(ath_un):
print(gc_json_well_progress)
Expand All @@ -595,7 +595,7 @@ def index():
with StdoutRedirection(ath_un):
print(gc_json_dailysum_progress)
time.sleep(1)
gc.dwnld_insert_json_dailysummary(ath_un,gc_agent, start_date, end_date, gc_username, gc_password, mfp_username, display_name, output, db_host, db_name, superuser_un,superuser_pw, archive_to_dropbox,archive_radio,dbx_auth_token,encr_pass)
gc.dwnld_insert_json_dailysummary(ath_un,gc_agent, start_date, end_date_today, gc_username, gc_password, mfp_username, display_name, output, db_host, db_name, superuser_un,superuser_pw, archive_to_dropbox,archive_radio,dbx_auth_token,encr_pass)
gc_json_dailysum_progress = 'GC JSON daily summary data downloaded successfully'
with StdoutRedirection(ath_un):
print(gc_json_dailysum_progress)
Expand Down Expand Up @@ -646,7 +646,7 @@ def index():
with StdoutRedirection(ath_un):
print(mfp_progress)
time.sleep(1)
mfp.dwnld_insert_nutrition(mfp_username,mfp_password,ath_un,start_date,end_date,encr_pass,save_pwd,auto_synch,db_host,superuser_un,superuser_pw)
mfp.dwnld_insert_nutrition(mfp_username,mfp_password,ath_un,start_date,end_date_today,encr_pass,save_pwd,auto_synch,db_host,superuser_un,superuser_pw)
mfp_progress = 'MFP nutrition data downloaded successfully'
with StdoutRedirection(ath_un):
print(mfp_progress)
Expand Down
10 changes: 5 additions & 5 deletions src/athletedataapp_flask.py
Original file line number Diff line number Diff line change
Expand Up @@ -542,7 +542,7 @@ def index():
with StdoutRedirection(ath_un):
print(gc_fit_well_progress)
time.sleep(1)
gc.dwnld_insert_fit_wellness(ath_un, gc_agent,start_date,end_date,gc_username, gc_password, mfp_username, output, db_host, db_name, superuser_un,superuser_pw, archive_to_dropbox,archive_radio,dbx_auth_token,encr_pass)
gc.dwnld_insert_fit_wellness(ath_un, gc_agent,start_date,end_date_today,gc_username, gc_password, mfp_username, output, db_host, db_name, superuser_un,superuser_pw, archive_to_dropbox,archive_radio,dbx_auth_token,encr_pass)
gc_fit_well_progress = 'GC FIT wellness data downloaded successfully'
with StdoutRedirection(ath_un):
print(gc_fit_well_progress)
Expand All @@ -566,8 +566,8 @@ def index():
with StdoutRedirection(ath_un):
print(gc_json_well_progress)
time.sleep(1)
gc.dwnld_insert_json_wellness(ath_un, gc_agent, start_date, end_date, gc_username, gc_password, mfp_username, display_name, output, db_host, db_name, superuser_un,superuser_pw, archive_to_dropbox,archive_radio,dbx_auth_token,encr_pass)
gc.dwnld_insert_json_body_composition(ath_un, gc_agent, start_date, end_date, gc_username, gc_password, mfp_username, output, db_host, db_name, superuser_un,superuser_pw, archive_to_dropbox, archive_radio, dbx_auth_token,encr_pass)
gc.dwnld_insert_json_wellness(ath_un, gc_agent, start_date, end_date_today, gc_username, gc_password, mfp_username, display_name, output, db_host, db_name, superuser_un,superuser_pw, archive_to_dropbox,archive_radio,dbx_auth_token,encr_pass)
gc.dwnld_insert_json_body_composition(ath_un, gc_agent, start_date, end_date_today, gc_username, gc_password, mfp_username, output, db_host, db_name, superuser_un,superuser_pw, archive_to_dropbox, archive_radio, dbx_auth_token,encr_pass)
gc_json_well_progress = 'GC JSON wellness data downloaded successfully'
with StdoutRedirection(ath_un):
print(gc_json_well_progress)
Expand All @@ -591,7 +591,7 @@ def index():
with StdoutRedirection(ath_un):
print(gc_json_dailysum_progress)
time.sleep(1)
gc.dwnld_insert_json_dailysummary(ath_un,gc_agent, start_date, end_date, gc_username, gc_password, mfp_username, display_name, output, db_host, db_name, superuser_un,superuser_pw, archive_to_dropbox,archive_radio,dbx_auth_token,encr_pass)
gc.dwnld_insert_json_dailysummary(ath_un,gc_agent, start_date, end_date_today, gc_username, gc_password, mfp_username, display_name, output, db_host, db_name, superuser_un,superuser_pw, archive_to_dropbox,archive_radio,dbx_auth_token,encr_pass)
gc_json_dailysum_progress = 'GC JSON daily summary data downloaded successfully'
with StdoutRedirection(ath_un):
print(gc_json_dailysum_progress)
Expand Down Expand Up @@ -642,7 +642,7 @@ def index():
with StdoutRedirection(ath_un):
print(mfp_progress)
time.sleep(1)
mfp.dwnld_insert_nutrition(mfp_username,mfp_password,ath_un,start_date,end_date,encr_pass,save_pwd,auto_synch,db_host,superuser_un,superuser_pw)
mfp.dwnld_insert_nutrition(mfp_username,mfp_password,ath_un,start_date,end_date_today,encr_pass,save_pwd,auto_synch,db_host,superuser_un,superuser_pw)
mfp_progress = 'MFP nutrition data downloaded successfully'
with StdoutRedirection(ath_un):
print(mfp_progress)
Expand Down
Loading

0 comments on commit 1cac4a5

Please sign in to comment.