Skip to content

Commit

Permalink
Merge pull request #9 from ViolaPioggia/main
Browse files Browse the repository at this point in the history
fix: fix the function of getting all the Renwen and Ziran courses
  • Loading branch information
L2ncE committed May 6, 2023
2 parents 5121330 + 76cabba commit 413b7ce
Showing 1 changed file with 14 additions and 12 deletions.
26 changes: 14 additions & 12 deletions query/queryer.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ func (q *Queryer) AllRenWen(cookie string) {
if err != nil {
log.Fatal(err)
}
var builder strings.Builder
for _, item := range classInfo.Data {
var builder strings.Builder
SRsLimit := strconv.Itoa(item.RsLimit)
SRwType := strconv.Itoa(item.RwType)

Expand All @@ -64,11 +64,12 @@ func (q *Queryer) AllRenWen(cookie string) {
for _, str := range strs {
builder.WriteString(str)
}
loads := builder.String()
err = ioutil.WriteFile("./output_renwen.txt", []byte(loads), 0o666) // 写入文件(字节数组)
if err != nil {
log.Fatal(err.Error())
}
builder.WriteString("\n")
}
loads := builder.String()
err = ioutil.WriteFile("./output_renwen.txt", []byte(loads), 0o666) // 写入文件(字节数组)
if err != nil {
log.Fatal(err.Error())
}
return
}
Expand All @@ -80,8 +81,8 @@ func (q *Queryer) AllZiRan(cookie string) {
if err != nil {
log.Fatal(err)
}
var builder strings.Builder
for _, item := range classInfo.Data {
var builder strings.Builder
SRsLimit := strconv.Itoa(item.RsLimit)
SRwType := strconv.Itoa(item.RwType)

Expand All @@ -94,11 +95,12 @@ func (q *Queryer) AllZiRan(cookie string) {
for _, str := range strs {
builder.WriteString(str)
}
loads := builder.String()
err = ioutil.WriteFile("./output_ziran.txt", []byte(loads), 0o666) // 写入文件(字节数组)
if err != nil {
log.Fatal(err.Error())
}
builder.WriteString("\n")
}
loads := builder.String()
err = ioutil.WriteFile("./output_ziran.txt", []byte(loads), 0o666) // 写入文件(字节数组)
if err != nil {
log.Fatal(err.Error())
}
return
}
Expand Down

0 comments on commit 413b7ce

Please sign in to comment.