syllabus

package
v0.0.0-...-7b13c63 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2021 License: MIT Imports: 8 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	Endpoint string
	// contains filtered or unexported fields
}

Client シラバスからデータを取得するクライアント

func NewClient

func NewClient(endpoint string, interval time.Duration) *Client

NewClient クライアントを作って返す

func (*Client) GetAllConciseSubjects

func (client *Client) GetAllConciseSubjects() ([]*ConciseSubject, error)

GetAllConciseSubjects すべての表を取得して科目の列にして返す

func (*Client) GetFirstTable

func (client *Client) GetFirstTable() (*Table, error)

GetFirstTable 開いたときに表示されるはじめの表を取得する

func (*Client) GetSubject

func (client *Client) GetSubject(timetableCode string) (*Subject, error)

GetSubject timetableCode(URLクエリパラメータのj、時間割コード)を指定してそのページを取得・パースして返す

func (*Client) GetTable

func (client *Client) GetTable(startIndex string) (*Table, error)

GetTable startIndex(URLクエリパラメータのs)を指定して表を取得する

type ConciseSubject

type ConciseSubject struct {
	// TimetableCode 時間割コード
	TimetableCode string `json:"timetable_code,omitempty"`
	// CourseTitle 科目名
	CourseTitle string `json:"course_title,omitempty"`
	// Semester 開講期
	Semester string `json:"semester,omitempty"`
	// DayAndPeriod 開講時間帯
	DayAndPeriod string `json:"day_and_period,omitempty"`
	// Grade 対象学年
	Grade string `json:"grade,omitempty"`
	// Credits 単位数
	Credits string `json:"credits,omitempty"`
	// Update 更新日
	Update string `json:"update,omitempty"`
}

ConciseSubject 科目一覧の表の科目(情報がSubjectより少ない)

type Subject

type Subject struct {
	// CourseTitle 科目名
	CourseTitle string `json:"course_title,omitempty"`
	// Update 更新日
	Update string `json:"update,omitempty"`
	// TimetableCode 時間割コード
	TimetableCode string `json:"timetable_code,omitempty"`
	// URL 科目詳細ページへのURL
	URL string `json:"url,omitempty"`
	// JapaneseValues 科目詳細ページの日本語の小見出しと内容のmap
	JapaneseValues map[string]string `json:"japanese_values,omitempty"`
	// EnglishValues 科目詳細ページの英語の小見出しと内容のmap
	EnglishValues map[string]string `json:"english_values,omitempty"`
}

Subject 科目の詳細のページに相当

type Table

type Table struct {
	Subjects []*ConciseSubject `json:"subjects,omitempty"`
	// PrevStartIndex [前のn件]のボタンのstartIndex
	PrevStartIndex string `json:"prev_start_index,omitempty"`
	// NextStartIndex [次のn件]のボタンのstartIndex
	NextStartIndex string `json:"next_start_index,omitempty"`
}

Table 科目一覧の表のページに相当

Jump to

Keyboard shortcuts

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