Closed samhinshaw closed 7 years ago
Awesome -- thanks for the contribution, @samhinshaw! I think this'll be very useful for people, and am glad you posted a pull request adding this!
The only thing I'd recommend doing -- if you could find the time -- is adding a test case. It's not super complicated, and I'm definitely going to merge your changes without the test case, but I'd really appreciate it if you could add one when you find the time.
Briefly, the way our test cases work is that you save an anonymized (remove anything private-looking from the HTML) copy of the HTML page you're scraping for gathering exercise data to the tests/html
folder, and create a test method that validates that the data you expect is returned when parsing your sample document. Test cases like that are invaluable for identifying what has changed when MyFitnessPal changes their UI.
Incidentally -- your python is perfect :heart:.
Thank you! 😊 I'm glad I could help, and I hope people do find this useful. I will check out the existing test cases and add some tests for the new methods!
Exercise
, an object containing exercise entries for each group of exercises (cardio & strength)_get_url_for_exercise
, an internal method for appending the baseURL to a specific user and date’s exercise diary_get_exercise
, an internal method for extracting cardio & strength training exercise data from a given user and dateget_exercise
, a public method which returns an array of Exercise objects for a given user and dateThis is based off the proposed changes in PR #43 I'm new to python development (I mostly use R & JS), so there may be some best practices not observed and methods I could have implemented better:
Exercise
class. However, the differences between cardio and strength training disincentivized me from attempting this.Day
class as well, but it seemed unnecessary.get_exercise
.