4
|
1 package lectable
|
|
2
|
|
3 import (
|
|
4 "context"
|
|
5 "fmt"
|
|
6 "io"
|
5
|
7
|
|
8 "ie.u-ryukyu.ac.jp/hg/y19/index.cgi/home/hg/y19/k198584/Tools/lectable/syllabus"
|
4
|
9 )
|
|
10
|
|
11 type cmdDownload struct{}
|
|
12
|
|
13 func (cd *cmdDownload) name() string {
|
|
14 return "download"
|
|
15 }
|
|
16
|
|
17 func (cd *cmdDownload) description() string {
|
|
18 return "donwload html from lecture ids"
|
|
19 }
|
|
20
|
|
21 func (cd *cmdDownload) run(ctx context.Context, argv []string, outStream, errStream io.Writer) error {
|
|
22 fmt.Println("download now!!")
|
5
|
23 dh := syllabus.CreateGetSyllabus()
|
|
24 _, err := dh.CheckAndMkdirBuilddir()
|
|
25 if err != nil {
|
|
26 return err
|
|
27 }
|
|
28 arr3 := []string{"601495001", "600625001"}
|
|
29
|
8
|
30 lwps, err := dh.LecIDStoDonwlodSyllabus(ctx, arr3, outStream)
|
9
|
31
|
|
32 return dh.DumpLectureWithPathJSON(lwps)
|
4
|
33 }
|
9
|
34
|
|
35
|