Skip to content

hashcott/student-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

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

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

Type: boolean


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

Type: Object


Khởi chạy browser headless.

Type: function ()


Đă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

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

Type: Array


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

Type: Array


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

Type: Array


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

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

Type: Object


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 twitter following me on facebook twitter

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published