View Workout (Jacob Young)

Calendar - Statistics - Workouts

Return to Log Return to Log

Running Log Downloader

April 24, 2018 (Afternoon)

Exercise Type: Weights

Comments:
I spent my afternoon today (about 5.5 hours) creating a tool for downloading all your logs onto your computer: https://bitbucket.org/TheJacobYoung/runninglogdownloader

If you have a bitbucket account, you can go ahead and clone the repo and contribute to it if you like. Otherwise, you can just download the Python script. On the left, click Downloads -> Download repository. This will download a zip file of the files. There's only 3 of them: a .gitignore file which doesn't mean anything to you, a README that is very important for figuring out how the script works, and the actual python script. Unzip the folder and follow the instructions in the README. There is some setup involved that might be tricky if you've never worked with python before. But google is a really cool thing and if you know how to use that you should be able to figure things out.

I tested out the script on my computer and it works perfectly. But there might be some edge cases that I don't know about so give it a go and let me know what issues you run into. If you have trouble reading the README because you don't have a dank text editor, I'll repost it here:



RunningLogDownloader

This is a Python tool for downloading all your logs on running-log.com.

Requirements:
1. Have python3 installed on your machine. You can do that here: https://www.python.org/downloads/
2. Install BeautifulSoup. This can be done by running the command "pip install BeautifulSoup4" on your command line.
3. Install requests. This can be done by running the command "pip install requests" on your command line.
4. Have an account on running-log.com

How to use:
First download the the file in this repositiory "running_log_downloader.py" into the directory where you want all your logs saved. Then, open a terminal in this directory and run the command "python running_log_downloader.py <email> <password>" where email and password are your credentials for running-log.com. Obviously, do not include the <> symbols.

This script will go back in your log history and download every log that you have posted - starting with your oldest ones - as html files. You will see in a file explorer that two folders will have been made in the directory where you saved this script: "logs" and "assets". "logs" is the folder where all your logs are to be saved, and "assets" just contains the running-log logo and a css file. The assets are included to make the pages that are downloaded look a little nicer.


File names for your logs follow the following format: DATE(Time of Day)_(Exercise Type)_TITLE.html. Example: "2017-03-05(M)_(Run)_Attempt to run through injury.html". The date is in the form YYYY-MM-DD, and the Time of Day is either M (morning), A (afternoon), or N (Night). Addtionally, all invalid file name characters were removed from log titles.

Upon each run of the script, files will be overwritten. None will be deleted.

Known issues:
This script does not do much error checking or error handling. running-log.com is known to have issues, and this may impact you when you run the script.



MAC USERS/PPL WHO HAVE NEVER USED PYTHON BEFORE/DON'T KNOW WHAT A TERMINAL IS:

Okay, buckle up. If you have no previous python experience and also use a Mac, then welcome to the tutorial for you.

First off, download python in step 1. Make sure that you choose the version that starts with 3. After that, you're going to run into some issues.

The command line that Jacob mentions is called "terminal" on Mac. Open spotlight(either hit CMD+Space, or click the magnifying glass in the upper right hand corner of the menu bar) and launch it.

Now, for the second step that Jacob put down, copy and paste this(WITHOUT the quotation marks, obviously). "python3 -m pip install BeautifulSoup4". This should trigger a bunch of stuff to happen that frankly you don't care about. Congrats.

For the next step, keep terminal open, but this time type, "python3 -m pip install requests". Again, you should be seeing a bunch of stuff loading on the screen.

Alright, now we're going to settings. Go to Keyboard -> shortcuts -> services(found on the left side menu), and then scroll down on the right and check the box next to, "New Terminal at Folder".

At this point you need to move the file called "running_log_downloader.py" that you downloaded from Jacob to wherever you want the logs to be. Make sure it's in a folder.

Now, right click on the folder with the file in it. At the bottom click, "New Terminal at Folder". This will in turn open a terminal window(duh). Now type, "python3 running_log_downloader.py (email) (password)" for example, "python3 running_log_downloader.py eskeddit@lilpump.com hunter2"

Congrats. You're done. The logs that you just downloaded will be in the folder and you're all set.

If that didn't work, hit me up on twitter @alanglinais7 and I might help you if you have enough clout.