Documentation ¶
Index ¶
- Constants
- type Api
- func (a *Api) GetLastTweet(uid int64) (*SimpleTweet, error)
- func (a *Api) GetMentions(tweetId int64, timeout *time.Duration) (*SimpleTweet, error)
- func (a *Api) GetTweet(tweetId int64, timeout *time.Duration) (*SimpleTweet, error)
- func (a *Api) GetTweets(userId int64, maxCount int64, sinceId *int64, timeout *time.Duration) ([]SimpleTweet, error)
- func (a *Api) GetTweetsSinceTime(uid int64, sinceTime time.Time, timeout *time.Duration) ([]SimpleTweet, error)
- func (a *Api) GetUserById(userId int64) (*SimpleUser, error)
- func (a *Api) GetUserByUsername(username string) (*SimpleUser, error)
- func (a *Api) RateLimit() time.Duration
- type SimpleTweet
- type SimpleUser
- type Url
- type UrlType
Constants ¶
View Source
const (
// https://developer.twitter.com/en/docs/tweets/timelines/api-reference/get-statuses-user_timeline.html
MaxRetrieveTweets = 200
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Api ¶
type Api struct {
// contains filtered or unexported fields
}
func (*Api) GetLastTweet ¶
func (a *Api) GetLastTweet(uid int64) (*SimpleTweet, error)
func (*Api) GetMentions ¶
func (*Api) GetTweetsSinceTime ¶
func (*Api) GetUserById ¶
func (a *Api) GetUserById(userId int64) (*SimpleUser, error)
func (*Api) GetUserByUsername ¶
func (a *Api) GetUserByUsername(username string) (*SimpleUser, error)
username is @username, NOT nickname(showname)
type SimpleTweet ¶
type SimpleTweet struct { Id int64 // Tweet Id UserName string // For generate tweet url FullText string UserId int64 Time time.Time PhotoUrls []string AnimatedGifUrls []string VideoUrls []string ReTweetCount int FavoriteCount int CommentCount int }
func (*SimpleTweet) GetCleanText ¶
func (t *SimpleTweet) GetCleanText() string
去除末尾大量的不构成语句组成部分的 @... #... example: https://twitter.com/H_O_L_O_/status/1046193782033731584/photo/1 https://twitter.com/H_O_L_O_/status/1045495983126327297
func (*SimpleTweet) GetTextWithoutAtHashtag ¶
func (t *SimpleTweet) GetTextWithoutAtHashtag() string
Removes hashtags and @s from tweet, preserves content after # character. Reference: https://github.com/Conorbro/twitter-sentiment-analysis/blob/master/utils.go
func (*SimpleTweet) GetUrl ¶
func (t *SimpleTweet) GetUrl() string
type SimpleUser ¶
type SimpleUser struct { Id int64 // Global unique int64 id given by twitter, user can't modify it UserName string // Global unique string user name in whole twitter site, users can modify it DisplayName string // Display name whatever user likes FollowersCount int FollowingCount int TweetsCount int JoinedTime time.Time Birthday time.Time Location string Lang langdetect.Language Timezone time.Location }
Click to show internal directories.
Click to hide internal directories.