Body Temperature

[ data-exfil ]

Take your temperature every morning. Own the data.

  1. Get a bluetooth-connected, ear thermometer that feeds data to Apple Health.
  2. export your apple health data
  3. convert apple health xml to json for ease
  4. slice out temperature data for the date range you care about
npm install --global xml2json-command
xml2json < ~/Downloads/apple_health_export/export.xml > apple-health.json

cat apple-health.json | \
  jq '.HealthData.Record | .[] | \
  select((.type == "HKQuantityTypeIdentifierBodyTemperature") \
    and (.creationDate > "2016-12-31") and (.creationDate < "2018-01-01")) | \
  [.creationDate, .value, .unit]' | \
  jq -r '. | @csv' > 2017-temperatures.csv
cat
...
"2017-12-04 21:29:35 -0800","98.42","degF"
"2017-12-05 07:23:07 -0800","97.16","degF"
"2017-12-06 08:39:52 -0800","96.62","degF"
...