1. 修复 store_extractor Update 错误.

2. 重构前两个网站的代码架构不合理.
3. 减少冗余代码
This commit is contained in:
eson
2020-08-13 19:11:53 +08:00
parent 36c28826ba
commit b20f97f7c9
16 changed files with 76 additions and 148 deletions

View File

@@ -1,6 +1,5 @@
package main
func main() {
e := ChannelLink{}
e.Execute()
Execute()
}

View File

@@ -17,12 +17,8 @@ var estore *intimate.StoreExtractor = intimate.NewStoreExtractor()
// 获取类型的所有频道链接
// ChannelLink 频道链接
type ChannelLink struct {
}
// Execute 执行任务
func (cl *ChannelLink) Execute() {
func Execute() {
var err error
wd := intimate.GetChromeDriver(3030)
ps := intimate.NewPerfectShutdown()

View File

@@ -4,9 +4,8 @@ import (
"testing"
)
func TestCase1(t *testing.T) {
e := ChannelLink{}
e.Execute()
func estCase1(t *testing.T) {
Execute()
}
func TestLiveUrl(t *testing.T) {

View File

@@ -1,6 +1,6 @@
package main
func main() {
ul := UserList{}
ul.Execute()
Execute()
}

View File

@@ -19,17 +19,12 @@ var estore *intimate.StoreExtractor = intimate.NewStoreExtractor()
// 获取类型的所有频道链接
// UserList 频道链接
type UserList struct {
}
// Execute 执行任务
func (cl *UserList) Execute() {
func Execute() {
// DELETE FROM source_twitch WHERE uid NOT IN (SELECT MAX(s.uid) FROM (SELECT uid, source FROM source_twitch ) s GROUP BY s.source) ;
//article//a[@data-a-target='preview-card-title-link']
wd := intimate.GetChromeDriver(3030)
defer wd.Close()
defer wd.Quit()
ps := intimate.NewPerfectShutdown()
counter := intimate.NewCounter()
@@ -174,7 +169,4 @@ func (cl *UserList) Execute() {
}
counter.AddWithReset(1)
}
wd.Close()
wd.Quit()
}

View File

@@ -2,6 +2,6 @@ package main
import "testing"
func TestMain(t *testing.T) {
func estMain(t *testing.T) {
main()
}