Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: fix the function of getting all the Renwen and Ziran courses #9

Merged
merged 1 commit into from
May 6, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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