Created
September 19, 2023 01:47
-
-
Save dannyob/2eb22f4112d8772b20425c34caebe1b9 to your computer and use it in GitHub Desktop.
Grab a historical record of weights from a MyNetDiary account
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ssconvert is part of the gnumeric package -- apt or brew install gnumeric | |
cd /tmp/ | |
PASSWORD=blahblahblah | |
[email protected] | |
JSESSIONID=$(curl 'https://www.mynetdiary.com/muiSignIn.do' -H 'accept: application/json, text/plain, */*' -H 'accept-language: en-US,en;q=0.7' -H 'content-type: application/json' -H 'origin: https://www.mynetdiary.com' -H 'referer: https://www.mynetdiary.com/logonPage.do' --data-raw '{"login": $USERNAME,"password":$PASSWORD,"rememberMe":true}' --compressed | jq -r .JSESSIONID) | |
curl --verbose -b JSESSIONID=$JSESSIONID 'https://www.mynetdiary.com/exportData.do?year=2023' --output mynetdiary.xls | |
ssconvert mynetdiary.xls -O 'sheet="Measurements"' measurements.csv | |
grep "Body Weight" < measurements.csv > weight.csv | |
rm -f mynetdiary.xls measurements.csv |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment