Mercurial > hg > Members > anatofuz > lectable
view cmd_donwload.go @ 11:e7d9f63d969c
move repository
author | anatofuz <anatofuz@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Tue, 31 Mar 2020 19:15:18 +0900 |
parents | b6a2d89b06e7 |
children | bac5eb544d4d |
line wrap: on
line source
package lectable import ( "context" "fmt" "io" "www.cr.ie.u-ryukyu.ac.jp/hg/Members/anatofuz/lectable/syllabus" ) type cmdDownload struct{} func (cd *cmdDownload) name() string { return "download" } func (cd *cmdDownload) description() string { return "donwload html from lecture ids" } func (cd *cmdDownload) run(ctx context.Context, argv []string, outStream, errStream io.Writer) error { fmt.Println("download now!!") dh := syllabus.CreateGetSyllabus() _, err := dh.CheckAndMkdirBuilddir() if err != nil { return err } arr3 := []string{"601495001", "600625001"} lwps, err := dh.LecIDStoDonwlodSyllabus(ctx, arr3, outStream) lectures, err := dh.LectureWPathS2LectureStruct(ctx, lwps, outStream) if err != nil { return err } return dh.DumpLecureToJson(lectures) }