Skip to content

Commit

Permalink
Merge pull request coddingtonbear#1 from tsatska/tsatska-patch-1
Browse files Browse the repository at this point in the history
Update client.py to add functionality for getting friends' diary entries
  • Loading branch information
tsatska committed Aug 25, 2020
2 parents 5ef73bb + b158709 commit daf9350
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions myfitnesspal/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,14 @@ def _get_url_for_date(self, date: datetime.date, username: str) -> str:
parse.urljoin(self.BASE_URL_SECURE, "food/diary/" + username)
+ f"?date={date_str}"
)


def _get_friend_url_for_date(self, date: datetime.date, friend_username: str) -> str:
date_str = date.strftime("%Y-%m-%d")
return (
parse.urljoin(self.BASE_URL_SECURE, "food/diary/" + friend_username)
+ f"?date={date_str}"
)

def _get_url_for_measurements(self, page: int = 1, measurement_id: int = 1) -> str:
return (
parse.urljoin(self.BASE_URL_SECURE, "measurements/edit")
Expand Down Expand Up @@ -470,7 +477,7 @@ def get_date(self, *args, **kwargs) -> Day:
)

return day

def get_measurements(
self, measurement="Weight", lower_bound=None, upper_bound=None
) -> Dict[datetime.date, float]:
Expand Down

0 comments on commit daf9350

Please sign in to comment.