/
5tay42.go
64 lines (50 loc) · 1.27 KB
/
5tay42.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
package storeClient
import "time"
type QuintaY42Section struct {
Name string `css:"a"`
Url string `css:"a" extract:"attr" attr:"href"`
Parent string
Store *Store
Priority int
ReadyTime time.Time
}
func (q *QuintaY42Section) SetReadyTime(readyTime time.Time) {
q.ReadyTime = readyTime
}
func (q *QuintaY42Section) GetName() string {
return q.Name
}
func (q *QuintaY42Section) GetUrl() string {
return q.Url
}
func (q *QuintaY42Section) GetParent() string {
return q.Parent
}
func (q *QuintaY42Section) GetStore() *Store {
return q.Store
}
func (q *QuintaY42Section) GetPriority(string) int {
return q.Priority
}
func (q *QuintaY42Section) GetReadyTime() time.Time {
return q.ReadyTime
}
type QuintaY42Product struct {
Name string `css:".product-name" extract:"attr" attr:"title"`
Price string `css:".product-price"`
Link string `css:".product-name" extract:"attr" attr:"href"`
Available string `css:".ajax_add_to_cart_button" extract:"attr" attr:"href"`
Section Section
}
func (q *QuintaY42Product) GetName() string {
return q.Name
}
func (q *QuintaY42Product) GetPrice() string {
return q.Price
}
func (q *QuintaY42Product) GetLink() string {
return q.Link
}
func (q *QuintaY42Product) GetSection() Section {
return q.Section
}