-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.js
44 lines (42 loc) · 941 Bytes
/
test.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
41
42
43
44
const query = require("querystring");
const url = require("url");
const HUFLIT = require("./modules/huflit"),
api = new HUFLIT();
const info = {
user: "19dh110251",
pass: "14052001",
};
(async () => {
// var user = await api.login(info);
try {
api.jar.setCookie(
"ASP.NET_SessionId=5madzcda0zlbebfbii1gy5yr",
"https://portal.huflit.edu.vn"
);
var is = await api.CheckCookie();
console.log(is);
if (!is.success) return;
var mark = await api.getMark();
mark = mark.data.filter(function (i) {
if (i.survey) return i;
});
// for (var i of mark) {
var res = await api.Survey(
{
SID: "202101005274",
PID: "19dh110251",
classId: 1,
auth: "c7fac99d863f4bc9804b81ecf98d9181",
YearStudy: "2020-2021",
TermID: "HK02",
},
4
);
console.log(res);
// }
} catch (error) {
console.log(error);
}
// var schedule = await api.getSchedules("HK02");
// console.log(schedule);
})();