finish tag slice

This commit is contained in:
eson
2020-08-11 18:26:17 +08:00
parent 23fa32b4ae
commit b82b4f5b77
13 changed files with 1317 additions and 211 deletions

View File

@@ -6,6 +6,7 @@ import (
"intimate"
"log"
"regexp"
"strings"
"time"
"github.com/tebeka/selenium"
@@ -48,6 +49,7 @@ func main() {
var updateUrl map[string]string
json.Unmarshal(streamer.UpdateUrl.([]byte), &updateUrl)
liveUrl := updateUrl["live"]
liveUrl = strings.Replace(liveUrl, "/watchparty", "", -1)
log.Println(liveUrl)
// err = wd.Get("https://www.twitch.tv/zoe_0601" + "/about")
@@ -67,6 +69,13 @@ func main() {
time.Sleep(time.Millisecond * 500)
err = extractUserName(wd, streamer)
if err != nil {
_, err = wd.FindElement(selenium.ByXPATH, "//a[@data-a-target='browse-channels-button']")
if err == nil {
log.Println(streamer.UserId, "may be cancell")
streamer.Operator = 5
streamer.UpdateTime = sql.NullTime{Time: time.Now(), Valid: true}
estore.UpdateStreamer(streamer)
}
continue
}
err = extractFollowers(wd, clog)
@@ -94,7 +103,7 @@ func main() {
}
streamer.Platform = intimate.Ptwitch
clog.Platform = string(streamer.Platform)
clog.Platform = streamer.Platform
clog.UpdateTime = sql.NullTime{Time: time.Now(), Valid: true}
lastClogId := estore.InsertClog(clog)