Last active
September 7, 2015 01:18
-
-
Save bewest/08dbe3c7589e4fe27246 to your computer and use it in GitHub Desktop.
medtronic openaps nightscout entries
This file contains 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
#!/bin/bash | |
HISTORY=${1-pumphistory.json} | |
OUTPUT=${2-pumphistory.ns.json} | |
TZ=${3} | |
cat $HISTORY | \ | |
json -e "this.medtronic = this._type;" | \ | |
json -e "this.dateString = this.timestamp + '$(TZ=TZ date +%z)'" | \ | |
json -e "this.type = 'medtronic'" | \ | |
json -e "this.date = this.date ? this.date : new Date(Date.parse(this.dateString)).getTime( )" \ | |
> $OUTPUT |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment