-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.go
35 lines (32 loc) · 823 Bytes
/
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
package main
import (
"encoding/json"
"fmt"
"github.com/gocolly/colly"
"log"
"os"
"strconv"
"strings"
)
type Watch struct {
UserID string `json:"User_Id"`
UserName string `json:"User-Name"`
UserProfile string `json:"User-Profile"`
ProductID string `json:"Product-ID"`
ProductProfile string `json:"Product_Link"`
WatchName string `json:"Product-Name"`
ProductDetail string `json:"Product-Detail"`
OldPrice string `json:"Old-Price"`
NewPrice string `json:"New-Price"`
LikesCount int `json:"Like-Count"`
CommentsCount int `json:"Comments-Count"`
Comments []WatchComment `json:"Comments"`
}
type WatchComment struct {
UserName string `json:"User-Name"`
Comment string
Replies []SubComment `json:"Replies"`
}
type SubComment struct {
SubComment []string
}