…well, there seems to be a way. If you follow one of the dexcom-pebble-watch-faces…you will find the way…
Just try a little simple reverse engineering. You will get to the share server… I do not know wether you are using the dexcom companion app. this is an official app for supporting family members or medical staff… and this is using the share server / share service.
Just a snippet of the pebble watch face code:
//use D's share API------------------------------------------//
function share(options) {
if (options.unit == "mgdl" || options.unit == "mg/dL")
{
fix = 0;
options.conversion = 1;
options.unit = "mg/dL";
} else {
fix = 1;
options.conversion = 0.0555;
options.unit = "mmol/L";
}
var host = "share1";
if (options.region != 'outside') {
host = "share1";
} else {
host = "shareous1";
}
options.vibe = parseInt(options.vibe, 10);
var defaults = {
"applicationId": "d89443d2-327c-4a6f-89e5-496bbb0317db"
, "agent": "Dexcom Share/3.0.2.11 CFNetwork/711.2.23 Darwin/14.0.0"
, login: 'https://' + host + '.dexcom.com/ShareWebServices/Services/General/LoginPublisherAccountByName'
, accept: 'application/json'
, 'content-type': 'application/json'
, LatestGlucose: "https://"+ host + ".dexcom.com/ShareWebServices/Services/Publisher/ReadPublisherLatestGlucoseValues"
};
authenticateShare(options, defaults);
}
function authenticateShare(options, defaults) {
var body = {
"password": options.password
, "applicationId": options.applicationId || defaults.applicationId
, "accountName": options.accountName
};
var http = new XMLHttpRequest();
var url = defaults.login;
http.open("POST", url, true);
http.setRequestHeader("User-Agent", defaults.agent);
http.setRequestHeader("Content-type", defaults['content-type']);
http.setRequestHeader('Accept', defaults.accept);
var data;
http.onload = function (e) {
if (http.status == 200) {
data = getShareGlucoseData(http.responseText.replace(/['"]+/g, ''), defaults, options);
} else {
sendAuthError();
}
};
http.ontimeout = function () {
sendTimeOutError(options);
};
http.onerror = function () {
sendServerError(options);
};
http.send(JSON.stringify(body));
}
This is be the result of reverse engineering of the official app…and this is in fact real time.
You can find the entire code within https://github.com/tynbendad/simplecgmanalog if you are downloading the zip-file within the pebble-js-app.js file. And this is in fact no rube-goldberg-machine or algorithm.
What do you think about it? I am quite happy seing it.