scrape

package
v0.0.0-...-f6b76fc Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 26, 2025 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Faculty

type Faculty struct {
	Value string `json:"value"`
	Name  string `json:"name"`
}

type Identity

type Identity struct {
	NIM      string `json:"nim"`
	Password string `json:"password"`
}

type Schedule

type Schedule struct {
	Hari     string `json:"hari"`
	Kode     string `json:"kode"`
	Matkul   string `json:"matkul"`
	Kelas    string `json:"kelas"`
	Sks      string `json:"sks"`
	Jam      string `json:"jam"`
	Semester string `json:"semester"`
	Dosen    string `json:"dosen"`
	Ruang    string `json:"ruang"`
}

type Scrape

type Scrape struct {
	// contains filtered or unexported fields
}

func NewScrape

func NewScrape(timeout int) *Scrape

NewScrape creates a new scraper with initialized ChromeDP context

func (*Scrape) Cleanup

func (s *Scrape) Cleanup()

func (*Scrape) GetSchedule

func (s *Scrape) GetSchedule(ctx context.Context, facultyID, programID string) ([]Schedule, error)

func (*Scrape) GetStudentData

func (s *Scrape) GetStudentData(ctx context.Context) (*Student, error)

func (*Scrape) GetStudyPlans

func (s *Scrape) GetStudyPlans(ctx context.Context) ([]StudyPlan, error)

func (*Scrape) GetStudyPrograms

func (s *Scrape) GetStudyPrograms(ctx context.Context) (map[string][]StudyProgram, error)

func (*Scrape) Initialize

func (s *Scrape) Initialize() error

Initialize sets up the ChromeDP context

func (*Scrape) Login

func (s *Scrape) Login(ctx context.Context, identity Identity) error

type Student

type Student struct {
	NIM           string
	Name          string
	Major         string
	Semester      string
	MaximumCredit string
}

type StudyPlan

type StudyPlan struct {
	Code       string
	Class      string
	CourseName string
	Credits    string
}

type StudyProgram

type StudyProgram struct {
	Value   string `json:"value"`
	Name    string `json:"name"`
	Faculty string `json:"faculty"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL