forked from n0madic/twitter-scraper
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtypes.go
110 lines (100 loc) · 2.74 KB
/
types.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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
package twitterscraper
import "time"
type (
// Mention type.
Mention struct {
ID string
Username string
Name string
}
// Photo type.
Photo struct {
ID string
URL string
}
// Video type.
Video struct {
ID string
Preview string
URL string
}
// Tweet type.
Tweet struct {
Hashtags []string
HTML string
ID string
InReplyToStatus *Tweet
IsQuoted bool
IsPin bool
IsReply bool
IsRetweet bool
Likes int
Name string
Mentions []Mention
PermanentURL string
Photos []Photo
Place *Place
QuotedStatus *Tweet
Replies int
Retweets int
RetweetedStatus *Tweet
Text string
TimeParsed time.Time
Timestamp int64
URLs []string
UserID string
Username string
Videos []Video
Views int
SensitiveContent bool
}
// ProfileResult of scrapping.
ProfileResult struct {
Profile
Error error
}
// TweetResult of scrapping.
TweetResult struct {
Tweet
Error error
}
legacyUser struct {
CreatedAt string `json:"created_at"`
Description string `json:"description"`
Entities struct {
URL struct {
Urls []struct {
ExpandedURL string `json:"expanded_url"`
} `json:"urls"`
} `json:"url"`
} `json:"entities"`
FavouritesCount int `json:"favourites_count"`
FollowersCount int `json:"followers_count"`
FriendsCount int `json:"friends_count"`
IDStr string `json:"id_str"`
ListedCount int `json:"listed_count"`
Name string `json:"name"`
Location string `json:"location"`
PinnedTweetIdsStr []string `json:"pinned_tweet_ids_str"`
ProfileBannerURL string `json:"profile_banner_url"`
ProfileImageURLHTTPS string `json:"profile_image_url_https"`
Protected bool `json:"protected"`
ScreenName string `json:"screen_name"`
StatusesCount int `json:"statuses_count"`
Verified bool `json:"verified"`
}
Place struct {
ID string `json:"id"`
PlaceType string `json:"place_type"`
Name string `json:"name"`
FullName string `json:"full_name"`
CountryCode string `json:"country_code"`
Country string `json:"country"`
BoundingBox struct {
Type string `json:"type"`
Coordinates [][][]float64 `json:"coordinates"`
} `json:"bounding_box"`
}
fetchProfileFunc func(query string, maxProfilesNbr int, cursor string) ([]*Profile, string, error)
fetchTweetFunc func(query string, maxTweetsNbr int, cursor string) ([]*Tweet, string, error)
)