Skip to content

Instantly share code, notes, and snippets.

View dannyob's full-sized avatar

Danny O'Brien dannyob

View GitHub Profile
@dannyob
dannyob / whatsmyweight.sh
Created September 19, 2023 01:47
Grab a historical record of weights from a MyNetDiary account
# ssconvert is part of the gnumeric package -- apt or brew install gnumeric
cd /tmp/
PASSWORD=blahblahblah
USERNAME=test@example.com
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
@dannyob
dannyob / IDLE with asyncio + imaplib + mbsyncrc
Created October 4, 2018 06:53 — forked from boris-arzur/IDLE with asyncio + imaplib + mbsyncrc
I use a mail stack based on mbsync & notmuch. I want to run mbsync on new mails. IDLE allows watching efficiently one folder in my mailbox. Async makes is easy to watch a few connections.
#!python3
import imaplib
import os
import asyncio
loop = asyncio.get_event_loop()
conf = [x.strip().split() for x in open('mbsyncrc')]

Keybase proof

I hereby claim:

  • I am dannyob on github.
  • I am malaclyps (https://keybase.io/malaclyps) on keybase.
  • I have a public key whose fingerprint is E1E7 0D6E 64BA 8D1F 74E7 8285 E500 1906 A3FD E45E

To claim this, I am signing this object: