-
Notifications
You must be signed in to change notification settings - Fork 43
/
Copy pathmain.go
67 lines (57 loc) · 1.05 KB
/
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
package main
import (
"Go-Spider/domain/dongqiudi"
"Go-Spider/domain/gushiwen"
"Go-Spider/infra/initial"
"Go-Spider/src/model"
"fmt"
)
func init() {
initial.DBInit()
CreateTable()
//Start()
}
func CreateTable() {
initial.DataBase.AutoMigrate(
// 古诗文
&model.RankListCBOInfo{},
&model.Dynasty{},
&model.PoetryType{},
&model.Poet{},
&model.PoetryInfo{},
// github 仓库
&model.Repositories{},
// pexles
&model.ImageSize{},
&model.ImageAddress{},
)
}
func Start() {
{
//cbooo.SaveCBOIntoDB()
}
{
// 古诗文抓取
var engine gushiwen.SimpleEngine
var results []gushiwen.Request
var rootURL = "https://www.gushiwen.org/shiwen/default.aspx?page=%d&type=0&id=0"
for index := 1; index <= 50; index++ {
url := fmt.Sprintf(rootURL, index)
results = append(results, gushiwen.Request{
URL: url,
})
}
engine.Run(
results,
)
}
}
func main() {
//defer initial.DataBase.Close()
//meizitu.Start()
dongqiudi.StartDongQiuDi()
//githubtrending.TrendingStart()
//pexels.Start()
//cmd.Execute()
//Start()
}