Add SearchProfiles

Minor changes and fixes
This commit is contained in:
Alexander Sheiko 2021-04-22 21:38:49 +03:00
parent f3597d0db6
commit 5032ecd29d
9 changed files with 268 additions and 100 deletions

View file

@ -43,12 +43,44 @@ type (
Videos []Video
}
// Result of scrapping.
Result struct {
// 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"`
}
// timeline JSON
timeline struct {
GlobalObjects struct {
@ -128,6 +160,9 @@ type (
Tweet struct {
ID string `json:"id"`
} `json:"tweet"`
User struct {
ID string `json:"id"`
} `json:"user"`
} `json:"content"`
} `json:"item"`
Operation struct {
@ -185,5 +220,6 @@ type (
} `json:"timeline"`
}
fetchFunc func(user string, maxTweetsNbr int, cursor string) ([]*Tweet, string, error)
fetchProfileFunc func(query string, maxProfilesNbr int, cursor string) ([]*Profile, string, error)
fetchTweetFunc func(query string, maxTweetsNbr int, cursor string) ([]*Tweet, string, error)
)