1.3.0 • Published 4 years ago

student-api v1.3.0

Weekly downloads
-
License
ISC
Repository
-
Last release
4 years ago

student-api

Install

npm install --save student-api

Usage

Đây là một ví dụ cào dữ liệu từ TLU.

const StudentAPI = require("student-api");
(async () => {
  const config = {
    baseURL: "http://dkh.tlu.edu.vn",
  };
  const api = new StudentAPI();
  api.config(config);
  await api.login({ idUser: "xxx", passwordUser: "xxx" });
  await api.close();
})();

API

Table of Contents

config

Type: function config (opts)

  • opts Object Options (optional, default {})
    • opts.baseURL : Địa chỉ web trường bạn (Bắt buộc phải có)
    • opts.browser Object? Puppeteer browser instance to use
    • opts.puppeteer Object? Puppeteer launch options

isAuthenticated

Kiểm tra đăng nhập thành công hay không ?

Type: boolean


user

Trả về user đã đăng nhập thành công

Type: Object


browser

Khởi chạy browser headless.

Type: function ()


login

Đăng nhập tự động.

Type: function (user): Promise

  • user object Tài khoản
    • user.idUser string Tên tài khoản
    • user.passwordUser string? Mật khẩu

studentTimeTable

Trả về lịch học theo kì

Type: Array


studyRegister

Trả về lịch học mới đăng kí

Type: Array


timeLineByDay

Trả về lịch học được nhóm theo ngày

Type: Array


getMarks

Trả về lịch học được nhóm theo ngày

{terms : ... , listMarks : ..., totals : ...}

Type: Object


close

Closes the underlying browser instance, effectively ending this session.

Type: function (): Promise


Related

License

MIT © 2KSOFT

Support my OSS work by following me on github following me on facebook

1.3.0

4 years ago

1.2.5

4 years ago

1.2.4

4 years ago

1.2.3

4 years ago

1.2.2

4 years ago

1.2.0

4 years ago

1.1.1

4 years ago

1.1.0

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago