-
Notifications
You must be signed in to change notification settings - Fork 4
/
parser.go
45 lines (41 loc) · 1004 Bytes
/
parser.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
package main
type WebSite struct {
WebSite string `json:"web_site"`
TitlePattern string `json:"title_pattern"`
ImgPattern string `json:"img_pattern"`
ImgAttrPattern string `json:"img_attr_pattern"`
ForceBig5 bool `json:"forceBig5"`
}
type Parser struct {
SupportSites []WebSite `json:"support_web_sites"`
}
var DefaultJson = []byte(`
{
"support_web_sites" : [
{
"web_site": "pixnet.net",
"title_pattern": "title",
"img_pattern" : ".article-content-inner p img",
"img_attr_pattern": "src"
},
{
"web_site": "ck101.com",
"title_pattern": "h1#thread_subject",
"img_pattern" : "div[itemprop=articleBody] img",
"img_attr_pattern": "file"
},
{
"web_site": "timliao.com",
"title_pattern": "title",
"img_pattern" : ".bodycontent img",
"img_attr_pattern": "src",
"forceBig5" : true
},
{
"web_site": "gigacircle.com",
"title_pattern": "title",
"img_pattern" : ".usercontent p img",
"img_attr_pattern": "src"
}
]
}`)