/
Microsoft_CC.js
40 lines (30 loc) · 1.47 KB
/
Microsoft_CC.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
"use strict";
const https = require("https");
const getBranch = "Microsoft_CC" + " ";
const getFFN = "5462eee5-1e97-495b-9370-853cd873bb07";
const getLastUpdated = "200922-1702";
const getBuild = "16.0.13231.20200";
function print(getBranch, getFFN, getLastUpdated, getBuild) {
console.log(getBranch + " : " + getFFN + " (" + getLastUpdated + ") : " + getBuild);
}
https.get("https://mrodevicemgr.officeapps.live.com/mrodevicemgrsvc/api/v2/C2RReleaseData?audienceFFN=" + getFFN, (getResponse) => {
getResponse.on("data", (getData) => {
if (getResponse.statusCode === 200) {
const getParsedData = JSON.parse(getData);
const getYear = getParsedData.TimestampUtc.substring(8, 10);
const getMonth = getParsedData.TimestampUtc.substring(0, 2);
const getDay = getParsedData.TimestampUtc.substring(3, 5);
const getHour = getParsedData.TimestampUtc.substring(11, 13);
const getMinute = getParsedData.TimestampUtc.substring(14, 16);
const getDate = getYear + getMonth + getDay;
const getTime = getHour + getMinute;
const getLastUpdated = getDate + "-" + getTime;
const getBuild = getParsedData.AvailableBuild;
print(getBranch, getFFN, getLastUpdated, getBuild);
} else {
print(getBranch, getFFN, getLastUpdated, getBuild);
}
});
}).on("error", (getError) => {
print(getBranch, getFFN, getLastUpdated, getBuild);
});