Documentation
¶
Index ¶
- Constants
- type Account
- type AccountList
- type AccountSettings
- type ActionResult
- type AdminResults
- type AllowDownloadStatus
- type AuthToken
- type AuthorCommunityRelationship
- type ClientEventDetails
- type ClientEventInfo
- type ColorInfo
- type ColorPalette
- type Community
- type CommunityActions
- type CommunityHashtagSlice
- type CommunityRelationship
- type CommunityRelationshipActions
- type CommunityResult
- type CommunityResults
- type CommunityRule
- type CommunityTimelineResponse
- type CommunityWithTimeline
- type CreatorResults
- type DmPermissions
- type EditControl
- type ExtMediaAvailability
- type ExtendedEntities
- type ExtendedMedia
- type FocusRect
- type GIF
- type HashtagEntity
- type InvitesResult
- type JoinRequestsResult
- type Media
- type MediaEntity
- type MediaFace
- type MediaFeatures
- type MediaInfo
- type MediaOriginalInfo
- type MediaPermissions
- type MediaResult
- type MediaResults
- type MediaSize
- type MediaSizes
- type MediaWrapper
- type Mention
- type ModerationState
- type NewTweet
- type OpenAccount
- type Photo
- type Place
- type ProcessingInfo
- type Profile
- type ProfileResult
- type QuotedStatusPermalink
- type QuotedStatusResult
- type RGB
- type RankedCommunityTimeline
- type RelationshipPerspectives
- type RootCommunityResponse
- type ScheduledTweet
- type Scraper
- func (s *Scraper) ClearCookies()
- func (s *Scraper) ClearGuestToken() error
- func (s *Scraper) CreateRetweet(tweetId string) (string, error)
- func (s *Scraper) CreateScheduledTweet(schedule TweetSchedule) (string, error)
- func (s *Scraper) CreateTweet(tweet NewTweet) (*Tweet, error)
- func (s *Scraper) DeleteRetweet(tweetId string) error
- func (s *Scraper) DeleteScheduledTweet(id string) error
- func (s *Scraper) DeleteTweet(tweetId string) error
- func (s *Scraper) FetchBookmarks(maxTweetsNbr int, cursor string) ([]*Tweet, string, error)
- func (s *Scraper) FetchFollowers(user string, maxUsersNbr int, cursor string) ([]*Profile, string, error)
- func (s *Scraper) FetchFollowersByUserID(userID string, maxUsersNbr int, cursor string) ([]*Profile, string, error)
- func (s *Scraper) FetchFollowing(user string, maxUsersNbr int, cursor string) ([]*Profile, string, error)
- func (s *Scraper) FetchFollowingByUserID(userID string, maxUsersNbr int, cursor string) ([]*Profile, string, error)
- func (s *Scraper) FetchForYouTweets(maxTweetsNbr int, cursor string) ([]*Tweet, string, error)
- func (s *Scraper) FetchHomeTweets(maxTweetsNbr int, cursor string) ([]*Tweet, string, error)
- func (s *Scraper) FetchMediaTweets(user string, maxTweetsNbr int, cursor string) ([]*Tweet, string, error)
- func (s *Scraper) FetchMediaTweetsByUserID(userID string, maxTweetsNbr int, cursor string) ([]*Tweet, string, error)
- func (s *Scraper) FetchScheduledTweets() ([]*ScheduledTweet, error)
- func (s *Scraper) FetchSearchProfiles(query string, maxProfilesNbr int, cursor string) ([]*Profile, string, error)
- func (s *Scraper) FetchSearchTweets(query string, maxTweetsNbr int, cursor string) ([]*Tweet, string, error)
- func (s *Scraper) FetchTweets(user string, maxTweetsNbr int, cursor string) ([]*Tweet, string, error)
- func (s *Scraper) FetchTweetsAndReplies(user string, maxTweetsNbr int, cursor string) ([]*Tweet, string, error)
- func (s *Scraper) FetchTweetsAndRepliesByUserID(userID string, maxReplysNbr int, cursor string) ([]*Tweet, string, error)
- func (s *Scraper) FetchTweetsByUserID(userID string, maxTweetsNbr int, cursor string) ([]*Tweet, string, error)
- func (s *Scraper) FetchTweetsByUserIDLegacy(userID string, maxTweetsNbr int, cursor string) ([]*Tweet, string, error)
- func (s *Scraper) GetAccountList() ([]Account, error)
- func (s *Scraper) GetAccountSettings() (AccountSettings, error)
- func (s *Scraper) GetBookmarks(ctx context.Context, maxTweetsNbr int) <-chan *TweetResult
- func (s *Scraper) GetCommunity(id string) (*Community, error)
- func (s *Scraper) GetCommunityTimeline(communityId string) (*CommunityTimelineResponse, error)
- func (s *Scraper) GetCookies() []*http.Cookie
- func (s *Scraper) GetForYouTweets(ctx context.Context, maxTweetsNbr int) <-chan *TweetResult
- func (s *Scraper) GetGuestToken() error
- func (s *Scraper) GetHomeTweets(ctx context.Context, maxTweetsNbr int) <-chan *TweetResult
- func (s *Scraper) GetMediaTweets(ctx context.Context, user string, maxTweetsNbr int) <-chan *TweetResult
- func (s *Scraper) GetProfile(username string) (Profile, error)
- func (s *Scraper) GetProfileByID(userID string) (Profile, error)
- func (s *Scraper) GetSpace(id string) (*Space, error)
- func (s *Scraper) GetTrends() ([]string, error)
- func (s *Scraper) GetTweet(id string) (*Tweet, error)
- func (s *Scraper) GetTweetReplies(id string, cursor string) ([]*Tweet, []*ThreadCursor, error)
- func (s *Scraper) GetTweetRetweeters(tweetId string, maxUsersNbr int, cursor string) ([]*Profile, string, error)
- func (s *Scraper) GetTweets(ctx context.Context, user string, maxTweetsNbr int) <-chan *TweetResult
- func (s *Scraper) GetTweetsAndReplies(ctx context.Context, user string, maxTweetsNbr int) <-chan *TweetResult
- func (s *Scraper) GetUserAgent() string
- func (s *Scraper) GetUserIDByScreenName(screenName string) (string, error)
- func (s *Scraper) Guest() string
- func (s *Scraper) IsGuestToken() bool
- func (s *Scraper) IsLoggedIn() bool
- func (s *Scraper) LikeTweet(tweetId string) error
- func (s *Scraper) Login(credentials ...string) error
- func (s *Scraper) LoginOpenAccount() (OpenAccount, error)
- func (s *Scraper) Logout() error
- func (s *Scraper) RequestAPI(req *http.Request, target interface{}) error
- func (s *Scraper) SearchProfiles(ctx context.Context, query string, maxProfilesNbr int) <-chan *ProfileResult
- func (s *Scraper) SearchTweets(ctx context.Context, query string, maxTweetsNbr int) <-chan *TweetResult
- func (s *Scraper) SetAuthToken(token AuthToken)
- func (s *Scraper) SetCookies(cookies []*http.Cookie)
- func (s *Scraper) SetProxy(proxyAddr string) error
- func (s *Scraper) SetSearchMode(mode SearchMode) *Scraper
- func (s *Scraper) SetUserAgent(userAgent string)
- func (s *Scraper) UnlikeTweet(tweetId string) error
- func (s *Scraper) UploadMedia(filePath string) (*Media, error)
- func (s *Scraper) WithClientTimeout(timeout time.Duration) *Scraper
- func (s *Scraper) WithDelay(seconds int64) *Scraper
- func (s *Scraper) WithOpenAccount(openAccount OpenAccount)
- func (s *Scraper) WithReplies(b bool) *Scraper
- type ScribeConfig
- type SearchMode
- type Space
- type SpaceParticipants
- type SpaceUser
- type SymbolEntity
- type ThreadCursor
- type Timeline
- type TimelineContent
- type TimelineEntry
- type TimelineInstruction
- type TimelineItemContent
- type TimelineMetadata
- type TimelinesDetails
- type Topic
- type Tweet
- type TweetCore
- type TweetEntities
- type TweetLegacy
- type TweetResult
- type TweetResults
- type TweetSchedule
- type TweetScopes
- type TweetUser
- type TweetUserCore
- type URLEntity
- type UnifiedCard
- type Url
- type User
- type UserAvatar
- type UserCore
- type UserEntities
- type UserEntityDescription
- type UserEntityURL
- type UserLegacy
- type UserLocation
- type UserMentionEntity
- type UserPrivacy
- type UserResult
- type UserResults
- type Verification
- type Video
- type ViewerRelationship
- type Views
Constants ¶
const DefaultClientTimeout = 10 * time.Second
default http client timeout
const DefaultUserAgent = "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/129.0.0.0 Safari/537.36"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Account ¶
type Account struct {
UserID string `json:"user_id"`
Name string `json:"name"`
ScreenName string `json:"screen_name"`
AvatarImageURL string `json:"avatar_image_url"`
IsSuspended bool `json:"is_suspended"`
IsVerified bool `json:"is_verified"`
IsProtected bool `json:"is_protected"`
IsAuthValid bool `json:"is_auth_valid"`
}
type AccountList ¶
type AccountList struct {
Users []Account `json:"users"`
}
type AccountSettings ¶
type AccountSettings struct {
ScreenName string `json:"screen_name"`
Protected bool `json:"protected"`
DisplaySensitiveMedia bool `json:"display_sensitive_media"`
Language string `json:"language"`
CountryCode string `json:"country_code"`
DiscoverableByEmail bool `json:"discoverable_by_email"`
DiscoverableByMobilePhone bool `json:"discoverable_by_mobile_phone"`
PersonalizedTrends bool `json:"personalized_trends"`
AllowMediaTagging string `json:"allow_media_tagging"`
AllowContributorRequest string `json:"allow_contributor_request"`
AllowAdsPersonalization bool `json:"allow_ads_personalization"`
AllowLoggedOutDevicePersonalization bool `json:"allow_logged_out_device_personalization"`
AllowLocationHistoryPersonalization bool `json:"allow_location_history_personalization"`
AllowSharingDataForThirdPartyPersonalization bool `json:"allow_sharing_data_for_third_party_personalization"`
AllowDmsFrom string `json:"allow_dms_from"`
AllowDmGroupsFrom string `json:"allow_dm_groups_from"`
AddressBookLiveSyncEnabled bool `json:"address_book_live_sync_enabled"`
UniversalQualityFilteringEnabled string `json:"universal_quality_filtering_enabled"`
DmReceiptSetting string `json:"dm_receipt_setting"`
AllowAuthenticatedPeriscopeRequests bool `json:"allow_authenticated_periscope_requests"`
ProtectPasswordReset bool `json:"protect_password_reset"`
RequirePasswordLogin bool `json:"require_password_login"`
RequiresLoginVerification bool `json:"requires_login_verification"`
DmQualityFilter string `json:"dm_quality_filter"`
AutoplayDisabled bool `json:"autoplay_disabled"`
}
type ActionResult ¶
type AdminResults ¶
type AdminResults struct {
Result TweetUser `json:"result"`
}
type AllowDownloadStatus ¶
type AllowDownloadStatus struct {
AllowDownload bool `json:"allow_download"`
}
type AuthorCommunityRelationship ¶
type AuthorCommunityRelationship struct {
CommunityResults CommunityResults `json:"community_results"`
Role string `json:"role"`
UserResults UserResults `json:"user_results"`
}
type ClientEventDetails ¶
type ClientEventDetails struct {
TimelinesDetails TimelinesDetails `json:"timelinesDetails"`
}
type ClientEventInfo ¶
type ClientEventInfo struct {
Component string `json:"component"`
Element string `json:"element"`
Details ClientEventDetails `json:"details"`
}
type ColorInfo ¶
type ColorInfo struct {
Palette []ColorPalette `json:"palette"`
}
type ColorPalette ¶
type Community ¶
type Community struct {
Typename string `json:"__typename"`
IsMember bool `json:"is_member"`
Name string `json:"name"`
Role string `json:"role"`
RestID string `json:"rest_id"`
Description string `json:"description"`
CreatorResults CreatorResults `json:"creator_results"`
JoinPolicy string `json:"join_policy"`
CreatedAt int64 `json:"created_at"`
Rules []CommunityRule `json:"rules"`
CustomBannerMedia MediaWrapper `json:"custom_banner_media"`
DefaultBannerMedia MediaWrapper `json:"default_banner_media"`
MembersFacepileResults []UserResult `json:"members_facepile_results"`
MemberCount int `json:"member_count"`
IsNSFW bool `json:"is_nsfw"`
ID string `json:"id"`
}
type CommunityActions ¶
type CommunityActions struct {
DeleteActionResult ActionResult `json:"delete_action_result"`
JoinActionResult ActionResult `json:"join_action_result"`
LeaveActionResult ActionResult `json:"leave_action_result"`
PinActionResult ActionResult `json:"pin_action_result"`
}
type CommunityHashtagSlice ¶
type CommunityHashtagSlice struct {
Typename string `json:"__typename"`
Items []interface{} `json:"items"`
}
type CommunityRelationship ¶
type CommunityRelationship struct {
ID string `json:"id"`
RestID string `json:"rest_id"`
ModerationState interface{} `json:"moderation_state"`
Actions CommunityRelationshipActions `json:"actions"`
}
type CommunityRelationshipActions ¶
type CommunityRelationshipActions struct {
PinActionResult ActionResult `json:"pin_action_result"`
UnpinActionResult ActionResult `json:"unpin_action_result"`
}
type CommunityResult ¶
type CommunityResult struct {
Typename string `json:"__typename"`
IdStr string `json:"id_str"`
Name string `json:"name,omitempty"`
Description string `json:"description,omitempty"`
CreatedAt int64 `json:"created_at,omitempty"`
Question string `json:"question,omitempty"`
SearchTags []interface{} `json:"search_tags,omitempty"`
IsNsfw bool `json:"is_nsfw,omitempty"`
Actions *CommunityActions `json:"actions,omitempty"`
AdminResults *AdminResults `json:"admin_results,omitempty"`
CreatorResults *CreatorResults `json:"creator_results,omitempty"`
InvitesResult *InvitesResult `json:"invites_result,omitempty"`
JoinPolicy string `json:"join_policy,omitempty"`
InvitesPolicy string `json:"invites_policy,omitempty"`
IsPinned bool `json:"is_pinned,omitempty"`
MembersFacepileResults []UserResults `json:"members_facepile_results,omitempty"`
ModeratorCount int `json:"moderator_count,omitempty"`
MemberCount int `json:"member_count,omitempty"`
Role string `json:"role,omitempty"`
Rules []CommunityRule `json:"rules,omitempty"`
CustomBannerMedia *MediaWrapper `json:"custom_banner_media,omitempty"`
DefaultBannerMedia *MediaWrapper `json:"default_banner_media,omitempty"`
ViewerRelationship *ViewerRelationship `json:"viewer_relationship"`
JoinRequestsResult *JoinRequestsResult `json:"join_requests_result,omitempty"`
}
type CommunityResults ¶
type CommunityResults struct {
Result CommunityResult `json:"result"`
}
type CommunityRule ¶
type CommunityTimelineResponse ¶
type CommunityTimelineResponse struct {
Data struct {
CommunityResults struct {
Result CommunityWithTimeline `json:"result"`
} `json:"communityResults"`
} `json:"data"`
}
type CommunityWithTimeline ¶
type CommunityWithTimeline struct {
Typename string `json:"__typename"`
RankedCommunityTimeline RankedCommunityTimeline `json:"ranked_community_timeline"`
}
type CreatorResults ¶
type DmPermissions ¶
type DmPermissions struct {
CanDm bool `json:"can_dm"`
}
type EditControl ¶
type ExtMediaAvailability ¶
type ExtMediaAvailability struct {
Status string `json:"status"`
}
type ExtendedEntities ¶
type ExtendedEntities struct {
Media []MediaEntity `json:"media"`
}
type ExtendedMedia ¶
type ExtendedMedia struct {
IDStr string `json:"id_str"`
MediaURLHttps string `json:"media_url_https"`
ExtSensitiveMediaWarning struct {
AdultContent bool `json:"adult_content"`
GraphicViolence bool `json:"graphic_violence"`
Other bool `json:"other"`
} `json:"ext_sensitive_media_warning"`
Type string `json:"type"`
URL string `json:"url"`
VideoInfo struct {
Variants []struct {
Type string `json:"content_type"`
Bitrate int `json:"bitrate"`
URL string `json:"url"`
} `json:"variants"`
} `json:"video_info"`
}
type HashtagEntity ¶
type InvitesResult ¶
type JoinRequestsResult ¶
type JoinRequestsResult struct {
Typename string `json:"__typename"`
}
type MediaEntity ¶
type MediaEntity struct {
DisplayURL string `json:"display_url"`
ExpandedURL string `json:"expanded_url"`
IdStr string `json:"id_str"`
Indices []int `json:"indices"`
MediaKey string `json:"media_key"`
MediaURLHttps string `json:"media_url_https"`
Type string `json:"type"`
URL string `json:"url"`
ExtMediaAvailability ExtMediaAvailability `json:"ext_media_availability"`
Features MediaFeatures `json:"features"`
Sizes MediaSizes `json:"sizes"`
OriginalInfo MediaOriginalInfo `json:"original_info"`
AllowDownloadStatus *AllowDownloadStatus `json:"allow_download_status,omitempty"`
MediaResults MediaResults `json:"media_results"`
}
type MediaFeatures ¶
type MediaOriginalInfo ¶
type MediaPermissions ¶
type MediaPermissions struct {
CanMediaTag bool `json:"can_media_tag"`
}
type MediaResult ¶
type MediaResult struct {
MediaKey string `json:"media_key"`
}
type MediaResults ¶
type MediaResults struct {
Result MediaResult `json:"result"`
}
type MediaSizes ¶
type MediaWrapper ¶
type ModerationState ¶
type ModerationState struct {
Typename string `json:"__typename"`
}
type OpenAccount ¶
type Place ¶
type 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"`
}
type ProcessingInfo ¶
type Profile ¶
type Profile struct {
Avatar string
Banner string
Biography string
Birthday string
FollowersCount int
FollowingCount int
FriendsCount int
IsPrivate bool
IsVerified bool
IsBlueVerified bool
Joined *time.Time
LikesCount int
ListedCount int
Location string
Name string
PinnedTweetIDs []string
TweetsCount int
URL string
UserID string
Username string
Website string
Sensitive bool
Following bool
FollowedBy bool
MediaCount int
FastFollowersCount int
NormalFollowersCount int
ProfileImageShape string
HasGraduatedAccess bool
CanHighlightTweets bool
}
Profile of twitter user.
type QuotedStatusPermalink ¶
type QuotedStatusResult ¶
type QuotedStatusResult struct {
Result TweetResult `json:"result"`
}
type RankedCommunityTimeline ¶
type RankedCommunityTimeline struct {
Timeline Timeline `json:"timeline"`
}
type RelationshipPerspectives ¶
type RelationshipPerspectives struct {
Following bool `json:"following"`
}
type RootCommunityResponse ¶
type RootCommunityResponse struct {
Data struct {
CommunityResults struct {
Result Community `json:"result"`
ID string `json:"id"`
} `json:"communityResults"`
} `json:"data"`
}
Community types
type ScheduledTweet ¶
type Scraper ¶
type Scraper struct {
// contains filtered or unexported fields
}
Scraper object
func (*Scraper) ClearCookies ¶
func (s *Scraper) ClearCookies()
func (*Scraper) ClearGuestToken ¶
func (*Scraper) CreateScheduledTweet ¶
func (s *Scraper) CreateScheduledTweet(schedule TweetSchedule) (string, error)
CreateScheduledTweet schedule new tweet.
func (*Scraper) DeleteRetweet ¶
Retweeted tweets has their own id, but to delete retweet twitter using id of source tweet
func (*Scraper) DeleteScheduledTweet ¶
DeleteScheduledTweet removes tweet from scheduled.
func (*Scraper) DeleteTweet ¶
func (*Scraper) FetchBookmarks ¶
FetchBookmarks gets bookmarked tweets via the Twitter frontend GraphQL API.
func (*Scraper) FetchFollowers ¶
func (s *Scraper) FetchFollowers(user string, maxUsersNbr int, cursor string) ([]*Profile, string, error)
FetchFollowers gets following profiles list for a given user, via the Twitter frontend GraphQL API.
func (*Scraper) FetchFollowersByUserID ¶
func (s *Scraper) FetchFollowersByUserID(userID string, maxUsersNbr int, cursor string) ([]*Profile, string, error)
FetchFollowersByUserID gets followers profiles list for a given userID, via the Twitter frontend GraphQL API.
func (*Scraper) FetchFollowing ¶
func (s *Scraper) FetchFollowing(user string, maxUsersNbr int, cursor string) ([]*Profile, string, error)
FetchFollowing gets following profiles list for a given user, via the Twitter frontend GraphQL API.
func (*Scraper) FetchFollowingByUserID ¶
func (s *Scraper) FetchFollowingByUserID(userID string, maxUsersNbr int, cursor string) ([]*Profile, string, error)
FetchFollowingByUserID gets following profiles list for a given userID, via the Twitter frontend GraphQL API.
func (*Scraper) FetchForYouTweets ¶
func (*Scraper) FetchHomeTweets ¶
func (*Scraper) FetchMediaTweets ¶
func (s *Scraper) FetchMediaTweets(user string, maxTweetsNbr int, cursor string) ([]*Tweet, string, error)
FetchMediaTweets gets tweets with medias for a given user, via the Twitter frontend API.
func (*Scraper) FetchMediaTweetsByUserID ¶
func (s *Scraper) FetchMediaTweetsByUserID(userID string, maxTweetsNbr int, cursor string) ([]*Tweet, string, error)
FetchMediaTweetsByUserID gets tweets with medias for a given userID, via the Twitter frontend GraphQL API.
func (*Scraper) FetchScheduledTweets ¶
func (s *Scraper) FetchScheduledTweets() ([]*ScheduledTweet, error)
FetchScheduledTweets gets scheduled tweets via the Twitter frontend GraphQL API.
func (*Scraper) FetchSearchProfiles ¶
func (s *Scraper) FetchSearchProfiles(query string, maxProfilesNbr int, cursor string) ([]*Profile, string, error)
FetchSearchProfiles gets users for a given search query, via the Twitter frontend API
func (*Scraper) FetchSearchTweets ¶
func (s *Scraper) FetchSearchTweets(query string, maxTweetsNbr int, cursor string) ([]*Tweet, string, error)
FetchSearchTweets gets tweets for a given search query, via the Twitter frontend API
func (*Scraper) FetchTweets ¶
func (s *Scraper) FetchTweets(user string, maxTweetsNbr int, cursor string) ([]*Tweet, string, error)
FetchTweets gets tweets for a given user, via the Twitter frontend API.
func (*Scraper) FetchTweetsAndReplies ¶
func (s *Scraper) FetchTweetsAndReplies(user string, maxTweetsNbr int, cursor string) ([]*Tweet, string, error)
FetchTweetsAndReplies gets tweets and replies for a given user, via the Twitter frontend API.
func (*Scraper) FetchTweetsAndRepliesByUserID ¶
func (s *Scraper) FetchTweetsAndRepliesByUserID(userID string, maxReplysNbr int, cursor string) ([]*Tweet, string, error)
FetchTweetsAndRepliesByUserID gets tweets and replies for a given userID, via the Twitter frontend GraphQL API.
func (*Scraper) FetchTweetsByUserID ¶
func (s *Scraper) FetchTweetsByUserID(userID string, maxTweetsNbr int, cursor string) ([]*Tweet, string, error)
FetchTweetsByUserID gets tweets for a given userID, via the Twitter frontend GraphQL API.
func (*Scraper) FetchTweetsByUserIDLegacy ¶
func (s *Scraper) FetchTweetsByUserIDLegacy(userID string, maxTweetsNbr int, cursor string) ([]*Tweet, string, error)
FetchTweetsByUserIDLegacy gets tweets for a given userID, via the Twitter frontend legacy API.
func (*Scraper) GetAccountList ¶
func (*Scraper) GetAccountSettings ¶
func (s *Scraper) GetAccountSettings() (AccountSettings, error)
func (*Scraper) GetBookmarks ¶
func (s *Scraper) GetBookmarks(ctx context.Context, maxTweetsNbr int) <-chan *TweetResult
GetBookmarks returns channel with tweets from user bookmarks.
func (*Scraper) GetCommunity ¶
GetCommunity retrieves community information by ID
func (*Scraper) GetCommunityTimeline ¶
func (s *Scraper) GetCommunityTimeline(communityId string) (*CommunityTimelineResponse, error)
GetCommunityTimeline retrieves the timeline/tweets from a community
func (*Scraper) GetCookies ¶
func (*Scraper) GetForYouTweets ¶
func (s *Scraper) GetForYouTweets(ctx context.Context, maxTweetsNbr int) <-chan *TweetResult
GetForYouTweets returns channel with tweets from for you timeline
func (*Scraper) GetGuestToken ¶
GetGuestToken from Twitter API
func (*Scraper) GetHomeTweets ¶
func (s *Scraper) GetHomeTweets(ctx context.Context, maxTweetsNbr int) <-chan *TweetResult
GetHomeTweets returns channel with tweets from home timeline
func (*Scraper) GetMediaTweets ¶
func (s *Scraper) GetMediaTweets(ctx context.Context, user string, maxTweetsNbr int) <-chan *TweetResult
GetTweets returns channel with tweets for a given user.
func (*Scraper) GetProfile ¶
GetProfile return parsed user profile.
func (*Scraper) GetTweetReplies ¶
func (*Scraper) GetTweetRetweeters ¶
func (*Scraper) GetTweetsAndReplies ¶
func (s *Scraper) GetTweetsAndReplies(ctx context.Context, user string, maxTweetsNbr int) <-chan *TweetResult
GetTweetsAndReplies returns channel with tweets and replies for a given user.
func (*Scraper) GetUserAgent ¶
func (*Scraper) GetUserIDByScreenName ¶
GetUserIDByScreenName from API
func (*Scraper) IsGuestToken ¶
IsGuestToken check if guest token not empty
func (*Scraper) IsLoggedIn ¶
IsLoggedIn check if scraper logged in
func (*Scraper) Login ¶
Login to Twitter Use Login(username, password) for ordinary login or Login(username, password, email) for login if you have email confirmation or Login(username, password, code_for_2FA) for login if you have two-factor authentication
func (*Scraper) LoginOpenAccount ¶
func (s *Scraper) LoginOpenAccount() (OpenAccount, error)
LoginOpenAccount as Twitter app
func (*Scraper) RequestAPI ¶
RequestAPI get JSON from frontend API and decodes it
func (*Scraper) SearchProfiles ¶
func (s *Scraper) SearchProfiles(ctx context.Context, query string, maxProfilesNbr int) <-chan *ProfileResult
SearchProfiles returns channel with profiles for a given search query
func (*Scraper) SearchTweets ¶
func (s *Scraper) SearchTweets(ctx context.Context, query string, maxTweetsNbr int) <-chan *TweetResult
SearchTweets returns channel with tweets for a given search query
func (*Scraper) SetAuthToken ¶
Auth using auth_token and ct0 cookies
func (*Scraper) SetCookies ¶
func (*Scraper) SetProxy ¶
SetProxy set http proxy in the format `http://HOST:PORT` set socket proxy in the format `socks5://HOST:PORT`
func (*Scraper) SetSearchMode ¶
func (s *Scraper) SetSearchMode(mode SearchMode) *Scraper
SetSearchMode switcher
func (*Scraper) SetUserAgent ¶
func (*Scraper) UnlikeTweet ¶
func (*Scraper) UploadMedia ¶
Uploads photo, video or gif for further posting or scheduling. Expires in 24 hours if not used.
func (*Scraper) WithClientTimeout ¶
client timeout
func (*Scraper) WithOpenAccount ¶
func (s *Scraper) WithOpenAccount(openAccount OpenAccount)
func (*Scraper) WithReplies ¶
WithReplies enable/disable load timeline with tweet replies
type ScribeConfig ¶
type ScribeConfig struct {
Page string `json:"page"`
}
type SearchMode ¶
type SearchMode int
SearchMode type
const ( // SearchTop - default mode SearchTop SearchMode = iota // SearchLatest - live mode SearchLatest // SearchPhotos - image mode SearchPhotos // SearchVideos - video mode SearchVideos // SearchUsers - user mode SearchUsers )
type SpaceParticipants ¶
type SymbolEntity ¶
type ThreadCursor ¶
type Timeline ¶
type Timeline struct {
Instructions []TimelineInstruction `json:"instructions"`
Metadata TimelineMetadata `json:"metadata"`
}
type TimelineContent ¶
type TimelineContent struct {
EntryType string `json:"entryType"`
Typename string `json:"__typename"`
ItemContent TimelineItemContent `json:"itemContent"`
ClientEventInfo ClientEventInfo `json:"clientEventInfo"`
Pinned bool `json:"pinned,omitempty"`
}
func (*TimelineContent) IsPinned ¶
func (t *TimelineContent) IsPinned() bool
IsPinned returns whether a timeline content is pinned
type TimelineEntry ¶
type TimelineEntry struct {
EntryID string `json:"entryId"`
SortIndex string `json:"sortIndex"`
Content TimelineContent `json:"content"`
}
type TimelineInstruction ¶
type TimelineInstruction struct {
Type string `json:"type"`
Entries []TimelineEntry `json:"entries,omitempty"`
Entry TimelineEntry `json:"entry,omitempty"`
}
type TimelineItemContent ¶
type TimelineItemContent struct {
ItemType string `json:"itemType"`
Typename string `json:"__typename"`
TweetResults TweetResults `json:"tweet_results"`
TweetDisplayType string `json:"tweetDisplayType"`
}
type TimelineMetadata ¶
type TimelineMetadata struct {
ScribeConfig ScribeConfig `json:"scribeConfig"`
}
type TimelinesDetails ¶
type TimelinesDetails struct {
InjectionType string `json:"injectionType"`
}
type Tweet ¶
type Tweet struct {
ConversationID string
GIFs []GIF
HTML string
ID string
InReplyToStatus *Tweet
InReplyToStatusID string
IsQuoted bool
IsPin bool
IsReply bool
IsRetweet bool
IsSelfThread bool
Likes int
Name string
Mentions []Mention
PermanentURL string
Photos []Photo
Place *Place
QuotedStatus *Tweet
QuotedStatusID string
Replies int
Retweets int
RetweetedStatus *Tweet
RetweetedStatusID string
Text string
Thread []*Tweet
TimeParsed time.Time
Timestamp int64
URLs []string
UserID string
Username string
Videos []Video
Views Views
SensitiveContent bool
}
Tweet type.
type TweetCore ¶
type TweetCore struct {
UserResults UserResults `json:"user_results"`
}
type TweetEntities ¶
type TweetEntities struct {
Media []MediaEntity `json:"media,omitempty"`
Symbols []SymbolEntity `json:"symbols"`
Timestamps []interface{} `json:"timestamps"`
URLs []URLEntity `json:"urls"`
UserMentions []UserMentionEntity `json:"user_mentions"`
}
type TweetLegacy ¶
type TweetLegacy struct {
BookmarkCount int `json:"bookmark_count"`
Bookmarked bool `json:"bookmarked"`
CreatedAt string `json:"created_at"`
ConversationIdStr string `json:"conversation_id_str"`
DisplayTextRange []int `json:"display_text_range"`
Entities TweetEntities `json:"entities"`
ExtendedEntities *ExtendedEntities `json:"extended_entities,omitempty"`
FavoriteCount int `json:"favorite_count"`
Favorited bool `json:"favorited"`
FullText string `json:"full_text"`
InReplyToScreenName string `json:"in_reply_to_screen_name,omitempty"`
InReplyToStatusIdStr string `json:"in_reply_to_status_id_str,omitempty"`
InReplyToUserIdStr string `json:"in_reply_to_user_id_str,omitempty"`
IsQuoteStatus bool `json:"is_quote_status"`
Lang string `json:"lang"`
PossiblySensitive bool `json:"possibly_sensitive"`
PossiblySensitiveEditable bool `json:"possibly_sensitive_editable"`
QuoteCount int `json:"quote_count"`
QuotedStatusIdStr string `json:"quoted_status_id_str,omitempty"`
QuotedStatusPermalink *QuotedStatusPermalink `json:"quoted_status_permalink,omitempty"`
ReplyCount int `json:"reply_count"`
RetweetCount int `json:"retweet_count"`
Retweeted bool `json:"retweeted"`
Scopes *TweetScopes `json:"scopes,omitempty"`
UserIdStr string `json:"user_id_str"`
IdStr string `json:"id_str"`
}
type TweetResults ¶
type TweetResults struct {
Result TweetResult `json:"result"`
}
type TweetScopes ¶
type TweetScopes struct {
Followers bool `json:"followers"`
}
type TweetUser ¶
type TweetUser struct {
Typename string `json:"__typename"`
ID string `json:"id"`
RestID string `json:"rest_id"`
AffiliatesHighlightedLabel interface{} `json:"affiliates_highlighted_label"`
Avatar UserAvatar `json:"avatar"`
Core TweetUserCore `json:"core"`
DmPermissions DmPermissions `json:"dm_permissions"`
HasGraduatedAccess bool `json:"has_graduated_access"`
IsBlueVerified bool `json:"is_blue_verified"`
Legacy UserLegacy `json:"legacy"`
Location UserLocation `json:"location"`
MediaPermissions MediaPermissions `json:"media_permissions"`
ParodyCommentaryFanLabel string `json:"parody_commentary_fan_label"`
ProfileImageShape string `json:"profile_image_shape"`
Privacy UserPrivacy `json:"privacy"`
RelationshipPerspectives RelationshipPerspectives `json:"relationship_perspectives"`
TipjarSettings interface{} `json:"tipjar_settings"`
Verification Verification `json:"verification"`
}
type TweetUserCore ¶
type UnifiedCard ¶
type UnifiedCard struct {
Type string `json:"type"`
Components []string `json:"components"`
MediaEntities map[string]struct {
ID int64 `json:"id"`
IDStr string `json:"id_str"`
MediaURLHTTPS string `json:"media_url_https"`
Type string `json:"type"`
OriginalInfo struct {
Width int `json:"width"`
Height int `json:"height"`
} `json:"original_info"`
SourceUserID int64 `json:"source_user_id"`
VideoInfo struct {
AspectRatio []int `json:"aspect_ratio"`
DurationMillis int `json:"duration_millis"`
Variants []struct {
Bitrate int `json:"bitrate,omitempty"`
ContentType string `json:"content_type"`
URL string `json:"url"`
} `json:"variants"`
} `json:"video_info"`
} `json:"media_entities"`
}
type Url ¶
type Url struct {
DisplayURL string `json:"display_url"`
ExpandedURL string `json:"expanded_url"`
URL string `json:"url"`
Indices []int `json:"indices"`
}
Url represents a URL with display, expanded, and index data.
type User ¶
type User struct {
Typename string `json:"__typename"`
ID string `json:"id"`
IsBlueVerified bool `json:"is_blue_verified"`
Core UserCore `json:"core"`
Verification Verification `json:"verification"`
Avatar *UserAvatar `json:"avatar,omitempty"`
}
type UserAvatar ¶
type UserAvatar struct {
ImageURL string `json:"image_url"`
}
type UserEntities ¶
type UserEntities struct {
Description UserEntityDescription `json:"description"`
URL *UserEntityURL `json:"url,omitempty"`
}
type UserEntityDescription ¶
type UserEntityDescription struct {
URLs []interface{} `json:"urls"`
}
type UserEntityURL ¶
type UserEntityURL struct {
URLs []URLEntity `json:"urls"`
}
type UserLegacy ¶
type UserLegacy struct {
DefaultProfile bool `json:"default_profile"`
DefaultProfileImage bool `json:"default_profile_image"`
Description string `json:"description"`
Entities UserEntities `json:"entities"`
FastFollowersCount int `json:"fast_followers_count"`
FavouritesCount int `json:"favourites_count"`
FollowersCount int `json:"followers_count"`
FriendsCount int `json:"friends_count"`
HasCustomTimelines bool `json:"has_custom_timelines"`
IsTranslator bool `json:"is_translator"`
ListedCount int `json:"listed_count"`
MediaCount int `json:"media_count"`
NormalFollowersCount int `json:"normal_followers_count"`
PinnedTweetIdsStr []string `json:"pinned_tweet_ids_str"`
PossiblySensitive bool `json:"possibly_sensitive"`
ProfileBannerURL string `json:"profile_banner_url,omitempty"`
ProfileInterstitialType string `json:"profile_interstitial_type"`
StatusesCount int `json:"statuses_count"`
TranslatorType string `json:"translator_type"`
URL string `json:"url,omitempty"`
WantRetweets bool `json:"want_retweets"`
WithheldInCountries []interface{} `json:"withheld_in_countries"`
}
type UserLocation ¶
type UserLocation struct {
Location string `json:"location"`
}
type UserMentionEntity ¶
type UserPrivacy ¶
type UserPrivacy struct {
Protected bool `json:"protected"`
}
type UserResult ¶
type UserResults ¶
type UserResults struct {
Result TweetUser `json:"result"`
}
type Verification ¶
type Verification struct {
Verified bool `json:"verified"`
}
type ViewerRelationship ¶
type ViewerRelationship struct {
ModerationState ModerationState `json:"moderation_state"`
}