This commit is contained in:
eson 2020-09-08 18:54:37 +08:00
parent fb07d61353
commit b5d5ec04e7

View File

@ -11,11 +11,11 @@ import (
"github.com/tebeka/selenium" "github.com/tebeka/selenium"
) )
// sstore 源存储实例, 为存储源数据的实现. 表格具体参考sql/intimate_source.sql // // sstore 源存储实例, 为存储源数据的实现. 表格具体参考sql/intimate_source.sql
var sstore *intimate.StoreSource = intimate.NewStoreSource(string(intimate.STTwitch)) // var sstore *intimate.StoreSource = intimate.NewStoreSource(string(intimate.STTwitch))
// estore 解析存储连接实例 // // estore 解析存储连接实例
var estore *intimate.StoreExtractor = intimate.NewStoreExtractor() // var estore *intimate.StoreExtractor = intimate.NewStoreExtractor()
// 获取类型的所有频道链接 // 获取类型的所有频道链接
@ -132,7 +132,8 @@ func Execute() {
matches := regexp.MustCompile(`https://www.twitch.tv/(\w+)`).FindStringSubmatch(href) matches := regexp.MustCompile(`https://www.twitch.tv/(\w+)`).FindStringSubmatch(href)
if len(matches) == 2 { if len(matches) == 2 {
streamer.UserId = matches[1] mc := matches[1]
streamer.UserId = &mc
} else { } else {
log.Println(href) log.Println(href)
continue continue
@ -149,7 +150,7 @@ func Execute() {
updateUrl := make(map[string]string) updateUrl := make(map[string]string)
updateUrl["live"] = href updateUrl["live"] = href
streamer.LiveUrl = sql.NullString{String: href, Valid: true} streamer.LiveUrl = &sql.NullString{String: href, Valid: true}
data, err := json.Marshal(updateUrl) data, err := json.Marshal(updateUrl)
if err != nil { if err != nil {
log.Println(err) log.Println(err)