Skip to content

Commit

Permalink
Update tidepoolsync.php
Browse files Browse the repository at this point in the history
  • Loading branch information
auxlife authored Aug 21, 2018
1 parent c47c6fc commit ae82289
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tidepoolsync.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ function RandomString($Length)
}
return implode($randstring);
}
rename("v1/dexcom.data" , "v1/data.old");
$file = file_get_contents("v1/data.old");
rename("api/v1/dexcom.data" , "api/v1/data.old");
$file = file_get_contents("api/v1/data.old");
$file = str_replace('[','',$file);
$file = explode("]",$file);
$json = array();
Expand Down Expand Up @@ -71,7 +71,7 @@ function RandomString($Length)
echo InsertValue($entry["dateString"], $entry["type"], $entry["mbg"] , '"payload":{"subType":"manual","time":"'.GetUTCTime($entry["dateString"]).'","timezoneOffset":'.GetUtcOffset().',"type":"smbg","units":"mmol/L","value":'.ConvertToMmol($entry["mbg"]).'}');
}
DisconnectDB();
rename("v1/data.old", "v1/olddata/".RandomString(12).".".RandomString(4));
rename("api/v1/data.old", "api/v1/olddata/".RandomString(12).".".RandomString(4));
echo "<br>Uploading to Tidepool:<br>";
Login();
ConnectDB();
Expand All @@ -82,4 +82,4 @@ function RandomString($Length)
}
DisconnectDB();
Logout();
?>
?>

0 comments on commit ae82289

Please sign in to comment.