Documentation ¶
Index ¶
- Variables
- type BlockResponse
- type BookmarkResponse
- type BookmarkedTweetsResponse
- type CallerData
- type Client
- func (c *Client) AddListMemeber(list_id, user_id string) (*ListMemberResponse, error)
- func (c *Client) Block(target_user_id string) (*BlockResponse, error)
- func (c *Client) BookmarkTweet(tweet_id string) (*BookmarkResponse, error)
- func (c *Client) CreateComplianceJob(job_type, name, resumable string) (*ComplianceJobResponse, error)
- func (c *Client) CreateList(name string, description string, private bool, params Map) (*ListResponse, error)
- func (c *Client) CreateTweet(text string, params Map) (*TweetResponse, error)
- func (c *Client) DeleteList(list_id string) (*DeleteResponse, error)
- func (c *Client) DeleteTweet(tweet_id string) (*DeleteResponse, error)
- func (c *Client) FollowList(list_id string) (*FollowResponse, error)
- func (c *Client) FollowUser(target_user_id string, params Map) (*FollowResponse, error)
- func (c *Client) GetAllTweetsCount(query string, params Map) (*TweetsCountResponse, error)
- func (c *Client) GetBlocked(params Map) (*UsersResponse, error)
- func (c *Client) GetBookmarkedTweets(params Map) (*BookmarkedTweetsResponse, error)
- func (c *Client) GetComplianceJob(job_id string) (*ComplianceJobResponse, error)
- func (c *Client) GetComplianceJobs(job_type string, params Map) (*ComplianceJobsResponse, error)
- func (c *Client) GetFollowedLists(user_id string, params Map) (*ListsResponse, error)
- func (c *Client) GetLikedTweets(user_id string, params Map) (*TweetsResponse, error)
- func (c *Client) GetLikingUsers(tweet_id string, params Map) (*UsersResponse, error)
- func (c *Client) GetList(list_id string, params Map) (*ListResponse, error)
- func (c *Client) GetListFollowers(list_id string, params Map) (*UsersResponse, error)
- func (c *Client) GetListMembers(list_id string, params Map) (*UsersResponse, error)
- func (c *Client) GetListMemberships(user_id string, params Map) (*ListsResponse, error)
- func (c *Client) GetListTweets(list_id string, params Map) (*TweetsResponse, error)
- func (c *Client) GetMe(oauth_1a bool, params Map) (*UserResponse, error)
- func (c *Client) GetMuted(params Map) (*MutedUsersResponse, error)
- func (c *Client) GetOwnedLists(user_id string, params Map) (*ListsResponse, error)
- func (c *Client) GetPinnedLists(params Map) (*ListsResponse, error)
- func (c *Client) GetQuoteTweets(tweet_id string, params Map) (*TweetsResponse, error)
- func (c *Client) GetRecentTweetsCount(query string, params Map) (*TweetsCountResponse, error)
- func (c *Client) GetRetweeters(tweet_id string, params Map) (*UsersResponse, error)
- func (c *Client) GetSpace(space_id string, params Map) (*SpaceResponse, error)
- func (c *Client) GetSpaceBuyers(space_id string, params Map) (*UsersResponse, error)
- func (c *Client) GetSpaceTweets(space_id string, params Map) (*TweetsResponse, error)
- func (c *Client) GetSpacesByCreatorIDs(creator_ids []string, params Map) (*SpacesResponse, error)
- func (c *Client) GetSpacesBySpaceIDs(space_ids []string, params Map) (*SpacesResponse, error)
- func (c *Client) GetTweet(tweet_id string, params Map) (*TweetResponse, error)
- func (c *Client) GetTweets(tweet_ids []string, params Map) (*TweetsResponse, error)
- func (c *Client) GetUserByID(user_id string, params Map) (*UserResponse, error)
- func (c *Client) GetUserByUsername(username string, params Map) (*UserResponse, error)
- func (c *Client) GetUserFollowers(user_id string, params Map) (*UsersResponse, error)
- func (c *Client) GetUserFollowing(user_id string, params Map) (*UsersResponse, error)
- func (c *Client) GetUserMentions(user_id string, params Map) (*TweetsResponse, error)
- func (c *Client) GetUserTweets(user_id string, params Map) (*TweetsResponse, error)
- func (c *Client) GetUsersByIDs(user_ids []string, params Map) (*UsersResponse, error)
- func (c *Client) GetUsersByUsernames(usernames []string, params Map) (*UsersResponse, error)
- func (c *Client) HideReply(reply_id string) (*HideReplyResponse, error)
- func (c *Client) Like(tweet_id string) (*LikeResponse, error)
- func (c *Client) Mute(target_user_id string) (*MuteResponse, error)
- func (c *Client) PinList(list_id string) (*PinResponse, error)
- func (c *Client) RemoveBookmark(tweet_id string) (*BookmarkResponse, error)
- func (c *Client) RemoveListMember(list_id, user_id string) (*ListMemberResponse, error)
- func (c *Client) Retweet(tweet_id string) (*RetweetResponse, error)
- func (c *Client) SearchAllTweets(query string, params Map) (*TweetsResponse, error)
- func (c *Client) SearchRecentTweets(query string, params Map) (*TweetsResponse, error)
- func (c *Client) SearchSpaces(query string, params Map) (*SpacesResponse, error)
- func (c *Client) SetDefaultOAuth(caller string) *Client
- func (c *Client) SetOAuth(oauth_type OAuthType) *Client
- func (c *Client) UnBlock(target_user_id string) (*BlockResponse, error)
- func (c *Client) UnHideReply(reply_id string) (*HideReplyResponse, error)
- func (c *Client) UnMute(target_user_id string) (*MuteResponse, error)
- func (c *Client) UnRetweet(tweet_id string) (*RetweetResponse, error)
- func (c *Client) UnfollowList(list_id string) (*FollowResponse, error)
- func (c *Client) UnfollowUser(target_user_id string) (*FollowResponse, error)
- func (c *Client) Unlike(tweet_id string) (*LikeResponse, error)
- func (c *Client) UnpinList(list_id string) (*PinResponse, error)
- func (c *Client) UpdateList(list_id string, name string, description string, private bool, params Map) (*UpdateListResponse, error)
- type ComplianceJobResponse
- type ComplianceJobsResponse
- type Config
- type DeleteResponse
- type ErrorEntity
- type FollowResponse
- type HideReplyResponse
- type IncludeGeo
- type IncludesEntity
- type LikeResponse
- type List
- type ListMemberResponse
- type ListResponse
- type ListsResponse
- type Map
- type Media
- type MetaEntity
- type MuteResponse
- type MutedUsersResponse
- type OAuthType
- type PinResponse
- type Place
- type Poll
- type PollOption
- type RateLimits
- type RetweetResponse
- type SpaceResponse
- type SpacesResponse
- type SpecialError
- type TweetResponse
- type TweetsCountResponse
- type TweetsResponse
- type UpdateListResponse
- type UserResponse
- type UsersResponse
Constants ¶
This section is empty.
Variables ¶
var DefaultOAuthes = map[string]OAuthType{ "": OAuth_Default, }
TODO: Should be completed, for example, Search tweets and Search spaces or muting have OAuth 1 as default, but others, have version 2 as default
Functions ¶
This section is empty.
Types ¶
type BlockResponse ¶
type BlockResponse struct { Data struct { Blocking bool `json:"blocking"` } Includes IncludesEntity Errors []ErrorEntity Meta MetaEntity RateLimits RateLimits }
func (*BlockResponse) Parse ¶
func (r *BlockResponse) Parse(raw_response *http.Response) (*BlockResponse, error)
type BookmarkResponse ¶
type BookmarkResponse struct { Data struct { Bookmarked bool `json:"bookmarked"` } Includes IncludesEntity Errors []ErrorEntity Meta MetaEntity RateLimits RateLimits }
func (*BookmarkResponse) Parse ¶
func (r *BookmarkResponse) Parse(raw_response *http.Response) (*BookmarkResponse, error)
type BookmarkedTweetsResponse ¶
type BookmarkedTweetsResponse struct { Data []entities.Tweet Includes IncludesEntity Errors []ErrorEntity Meta MetaEntity RateLimits RateLimits CallerData CallerData Caller func(Map) (*BookmarkedTweetsResponse, error) }
func (*BookmarkedTweetsResponse) NextPage ¶
func (r *BookmarkedTweetsResponse) NextPage() (*BookmarkedTweetsResponse, error)
func (*BookmarkedTweetsResponse) Parse ¶
func (r *BookmarkedTweetsResponse) Parse(raw_response *http.Response) (*BookmarkedTweetsResponse, error)
type CallerData ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func NewBearerOnlyClient ¶
func (*Client) AddListMemeber ¶
func (c *Client) AddListMemeber(list_id, user_id string) (*ListMemberResponse, error)
Enables the authenticated user to add a member to a List they own.
func (*Client) Block ¶
func (c *Client) Block(target_user_id string) (*BlockResponse, error)
** Blocks ** //
func (*Client) BookmarkTweet ¶
func (c *Client) BookmarkTweet(tweet_id string) (*BookmarkResponse, error)
Causes the authenticating user to Bookmark the target Tweet provided in the request body.
func (*Client) CreateComplianceJob ¶
func (c *Client) CreateComplianceJob(job_type, name, resumable string) (*ComplianceJobResponse, error)
Creates a new compliance job for Tweet IDs or user IDs.
A compliance job will contain an ID and a destination URL. The destination URL represents the location that contains the list of IDs consumed by your app.
You can run one batch job at a time.
func (*Client) CreateList ¶
func (c *Client) CreateList(name string, description string, private bool, params Map) (*ListResponse, error)
Enables the authenticated user to create a List.
https://developer.twitter.com/en/docs/twitter-api/lists/manage-lists/api-reference/post-lists
func (*Client) CreateTweet ¶
func (c *Client) CreateTweet(text string, params Map) (*TweetResponse, error)
Creates a Tweet on behalf of an authenticated user
Parameters ¶
text: Text of the Tweet being created. this field is required if media.media_ids is not present, otherwise pass empty string.
params: A map of parameters. you can pass some extra parameters, such as:
"direct_message_deep_link", "for_super_followers_only", "media", "geo", "poll", "reply", "reply_settings", "quote_tweet_id",
Some of these parameters are a little special and should be passed like this:
media := map[string][]string{ "media_ids": []string{} "tagged_user_ids": []string{} } poll := twigo.Map{ "options": map[string]string{}, "duration_minutes": int value, } reply := twigo.Map{ "in_reply_to_tweet_id": "", "exclude_reply_user_ids": []string{}, } geo := map[string]string{"place_id": value} params := twigo.Map{ "text": text "media": media, "geo": geo, "poll": poll, "reply": reply, }
Reference ¶
https://developer.twitter.com/en/docs/twitter-api/tweets/manage-tweets/api-reference/post-tweets
func (*Client) DeleteList ¶
func (c *Client) DeleteList(list_id string) (*DeleteResponse, error)
Enables the authenticated user to delete a List that they own.
https://developer.twitter.com/en/docs/twitter-api/lists/manage-lists/api-reference/delete-lists-id
func (*Client) DeleteTweet ¶
func (c *Client) DeleteTweet(tweet_id string) (*DeleteResponse, error)
Allows an authenticated user ID to delete a Tweet
Parameters ¶
tweet_id: The Tweet ID you are deleting.
References ¶
func (*Client) FollowList ¶
func (c *Client) FollowList(list_id string) (*FollowResponse, error)
Enables the authenticated user to follow a List.
func (*Client) FollowUser ¶
func (c *Client) FollowUser(target_user_id string, params Map) (*FollowResponse, error)
Allows a user ID to follow another user.
If the target user does not have public Tweets, this endpoint will send a follow request.
The request succeeds with no action when the authenticated user sends a request to a user they're already following, or if they're sending a follower request to a user that does not have public Tweets.
func (*Client) GetAllTweetsCount ¶
func (c *Client) GetAllTweetsCount(query string, params Map) (*TweetsCountResponse, error)
This endpoint is only available to those users who have been approved for the `Academic Research product track`_.
The full-archive search endpoint returns the complete history of public Tweets matching a search query; since the first Tweet was created March 26, 2006.
https://developer.twitter.com/en/docs/twitter-api/tweets/counts/api-reference/get-tweets-counts-all
func (*Client) GetBlocked ¶
func (c *Client) GetBlocked(params Map) (*UsersResponse, error)
Returns a list of users who are blocked by the authenticating user.
https://developer.twitter.com/en/docs/twitter-api/users/blocks/api-reference/get-users-blocking
func (*Client) GetBookmarkedTweets ¶
func (c *Client) GetBookmarkedTweets(params Map) (*BookmarkedTweetsResponse, error)
Allows you to get an authenticated user's 800 most recent bookmarked Tweets.
func (*Client) GetComplianceJob ¶
func (c *Client) GetComplianceJob(job_id string) (*ComplianceJobResponse, error)
Get a single compliance job with the specified ID.
func (*Client) GetComplianceJobs ¶
func (c *Client) GetComplianceJobs(job_type string, params Map) (*ComplianceJobsResponse, error)
Returns a list of recent compliance jobs.
func (*Client) GetFollowedLists ¶
func (c *Client) GetFollowedLists(user_id string, params Map) (*ListsResponse, error)
Returns all Lists a specified user follows.
func (*Client) GetLikedTweets ¶
func (c *Client) GetLikedTweets(user_id string, params Map) (*TweetsResponse, error)
Allows you to get information about a user’s liked Tweets.
The Tweets returned by this endpoint count towards the Project-level `Tweet cap`.
Parameters ¶
tweet_id: User ID of the user to request liked Tweets for.
params (keys):
"expansions", "media.fields", "place.fields", "poll.fields", "tweet.fields", "user.fields", "max_results"
References ¶
func (*Client) GetLikingUsers ¶
func (c *Client) GetLikingUsers(tweet_id string, params Map) (*UsersResponse, error)
Allows you to get information about a Tweet’s liking users.
Parameters ¶
tweet_id: Tweet ID of the Tweet to request liking users of.
params (keys):
"expansions", "media.fields", "place.fields", "poll.fields", "tweet.fields", "user.fields", "max_results"
References ¶
func (*Client) GetList ¶
func (c *Client) GetList(list_id string, params Map) (*ListResponse, error)
Returns the details of a specified List.
https://developer.twitter.com/en/docs/twitter-api/lists/list-lookup/api-reference/get-lists-id
func (*Client) GetListFollowers ¶
func (c *Client) GetListFollowers(list_id string, params Map) (*UsersResponse, error)
Returns a list of users who are followers of the specified List.
func (*Client) GetListMembers ¶
func (c *Client) GetListMembers(list_id string, params Map) (*UsersResponse, error)
Returns a list of users who are members of the specified List.
func (*Client) GetListMemberships ¶
func (c *Client) GetListMemberships(user_id string, params Map) (*ListsResponse, error)
Returns all Lists a specified user is a member of.
func (*Client) GetListTweets ¶
func (c *Client) GetListTweets(list_id string, params Map) (*TweetsResponse, error)
Returns a list of Tweets from the specified List.
func (*Client) GetMe ¶
func (c *Client) GetMe(oauth_1a bool, params Map) (*UserResponse, error)
Returns information about an authorized user.
https://developer.twitter.com/en/docs/twitter-api/users/lookup/api-reference/get-users-me
func (*Client) GetMuted ¶
func (c *Client) GetMuted(params Map) (*MutedUsersResponse, error)
Returns a list of users who are muted by the authenticating user.
https://developer.twitter.com/en/docs/twitter-api/users/mutes/api-reference/get-users-muting
func (*Client) GetOwnedLists ¶
func (c *Client) GetOwnedLists(user_id string, params Map) (*ListsResponse, error)
Returns all Lists owned by the specified user.
func (*Client) GetPinnedLists ¶
func (c *Client) GetPinnedLists(params Map) (*ListsResponse, error)
Returns the Lists pinned by a specified user.
func (*Client) GetQuoteTweets ¶
func (c *Client) GetQuoteTweets(tweet_id string, params Map) (*TweetsResponse, error)
Returns Quote Tweets for a Tweet specified by the requested Tweet ID.
The Tweets returned by this endpoint count towards the Project-level `Tweet cap`.
func (*Client) GetRecentTweetsCount ¶
func (c *Client) GetRecentTweetsCount(query string, params Map) (*TweetsCountResponse, error)
The recent Tweet counts endpoint returns count of Tweets from the last seven days that match a search query.
func (*Client) GetRetweeters ¶
func (c *Client) GetRetweeters(tweet_id string, params Map) (*UsersResponse, error)
Allows you to get information about who has Retweeted a Tweet.
Parameters ¶
tweet_id: Tweet ID of the Tweet to request Retweeting users of.
params (keys):
"expansions", "media.fields", "place.fields", "poll.fields", "tweet.fields", "user.fields", "max_results", "pagination_token"
References ¶
func (*Client) GetSpace ¶
func (c *Client) GetSpace(space_id string, params Map) (*SpaceResponse, error)
Returns a variety of information about a single Space specified by the requested ID.
https://developer.twitter.com/en/docs/twitter-api/spaces/lookup/api-reference/get-spaces-id
func (*Client) GetSpaceBuyers ¶
func (c *Client) GetSpaceBuyers(space_id string, params Map) (*UsersResponse, error)
Returns a list of user who purchased a ticket to the requested Space. You must authenticate the request using the Access Token of the creator of the requested Space.
https://developer.twitter.com/en/docs/twitter-api/spaces/lookup/api-reference/get-spaces-id-buyers
func (*Client) GetSpaceTweets ¶
func (c *Client) GetSpaceTweets(space_id string, params Map) (*TweetsResponse, error)
Returns Tweets shared in the requested Spaces.
https://developer.twitter.com/en/docs/twitter-api/spaces/lookup/api-reference/get-spaces-id-tweets
func (*Client) GetSpacesByCreatorIDs ¶
func (c *Client) GetSpacesByCreatorIDs(creator_ids []string, params Map) (*SpacesResponse, error)
Returns details about multiple live or scheduled Spaces created by the specified user IDs. Up to 100 comma-separated user IDs can be looked up using this method.
func (*Client) GetSpacesBySpaceIDs ¶
func (c *Client) GetSpacesBySpaceIDs(space_ids []string, params Map) (*SpacesResponse, error)
Returns details about multiple live or scheduled Spaces.
Up to 100 comma-separated Space IDs can be looked up using this method.
https://developer.twitter.com/en/docs/twitter-api/spaces/lookup/api-reference/get-spaces
func (*Client) GetTweet ¶
func (c *Client) GetTweet(tweet_id string, params Map) (*TweetResponse, error)
Returns a variety of information about a single Tweet specified by the requested ID.
https://developer.twitter.com/en/docs/twitter-api/tweets/lookup/api-reference/get-tweets-id
func (*Client) GetTweets ¶
func (c *Client) GetTweets(tweet_ids []string, params Map) (*TweetsResponse, error)
Returns a variety of information about the Tweet specified by the requested ID or list of IDs.
https://developer.twitter.com/en/docs/twitter-api/tweets/lookup/api-reference/get-tweets
func (*Client) GetUserByID ¶
func (c *Client) GetUserByID(user_id string, params Map) (*UserResponse, error)
Returns a variety of information about a single user specified by the requested ID.
https://developer.twitter.com/en/docs/twitter-api/users/lookup/api-reference/get-users-id
func (*Client) GetUserByUsername ¶
func (c *Client) GetUserByUsername(username string, params Map) (*UserResponse, error)
Returns a variety of information about a single user specified by the requested username.
func (*Client) GetUserFollowers ¶
func (c *Client) GetUserFollowers(user_id string, params Map) (*UsersResponse, error)
Returns a list of users who are followers of the specified user ID.
https://developer.twitter.com/en/docs/twitter-api/users/follows/api-reference/get-users-id-followers
func (*Client) GetUserFollowing ¶
func (c *Client) GetUserFollowing(user_id string, params Map) (*UsersResponse, error)
Returns a list of users the specified user ID is following
https://developer.twitter.com/en/docs/twitter-api/users/follows/api-reference/get-users-id-following
func (*Client) GetUserMentions ¶
func (c *Client) GetUserMentions(user_id string, params Map) (*TweetsResponse, error)
Returns Tweets mentioning a single user specified by the requested user ID. By default, the most recent ten Tweets are returned per request. Using pagination, up to the most recent 800 Tweets can be retrieved.
The Tweets returned by this endpoint count towards the Project-level `Tweet cap`.
func (*Client) GetUserTweets ¶
func (c *Client) GetUserTweets(user_id string, params Map) (*TweetsResponse, error)
Returns Tweets composed by a single user, specified by the requested user ID. By default, the most recent ten Tweets are returned per request. Using pagination, the most recent 3,200 Tweets can be retrieved.
The Tweets returned by this endpoint count towards the Project-level `Tweet cap`.
https://developer.twitter.com/en/docs/twitter-api/tweets/timelines/api-reference/get-users-id-tweets
func (*Client) GetUsersByIDs ¶
func (c *Client) GetUsersByIDs(user_ids []string, params Map) (*UsersResponse, error)
Returns a variety of information about one or more users specified by the requested IDs.
https://developer.twitter.com/en/docs/twitter-api/users/lookup/api-reference/get-users
func (*Client) GetUsersByUsernames ¶
func (c *Client) GetUsersByUsernames(usernames []string, params Map) (*UsersResponse, error)
Returns a variety of information about one or more users specified by the requested usernames.
usernames should not have @ at the beginning
https://developer.twitter.com/en/docs/twitter-api/users/lookup/api-reference/get-users-by
func (*Client) HideReply ¶
func (c *Client) HideReply(reply_id string) (*HideReplyResponse, error)
Hides a reply to a Tweet
Parameters ¶
reply_id:
Unique identifier of the Tweet to hide. The Tweet must belong to a conversation initiated by the authenticating user.
References ¶
func (*Client) Like ¶
func (c *Client) Like(tweet_id string) (*LikeResponse, error)
Like a Tweet.
Parameters ¶
tweet_id: The ID of the Tweet that you would like to Like.
References ¶
https://developer.twitter.com/en/docs/twitter-api/tweets/likes/api-reference/post-users-id-likesx
func (*Client) Mute ¶
func (c *Client) Mute(target_user_id string) (*MuteResponse, error)
** Mutes ** // Allows an authenticated user ID to mute the target user.
func (*Client) PinList ¶
func (c *Client) PinList(list_id string) (*PinResponse, error)
Enables the authenticated user to pin a List.
func (*Client) RemoveBookmark ¶
func (c *Client) RemoveBookmark(tweet_id string) (*BookmarkResponse, error)
Allows a user or authenticated user ID to remove a Bookmark of a Tweet.
func (*Client) RemoveListMember ¶
func (c *Client) RemoveListMember(list_id, user_id string) (*ListMemberResponse, error)
Enables the authenticated user to remove a member from a List they own.
func (*Client) Retweet ¶
func (c *Client) Retweet(tweet_id string) (*RetweetResponse, error)
Causes the user ID to Retweet the target Tweet.
Parameters ¶
tweet_id: The ID of the Tweet that you would like to Retweet.
References ¶
func (*Client) SearchAllTweets ¶
func (c *Client) SearchAllTweets(query string, params Map) (*TweetsResponse, error)
The full-archive search endpoint returns the complete history of public Tweets matching a search query; since the first Tweet was created March 26, 2006.
This endpoint is only available to those users who have been approved for the `Academic Research product track`
The Tweets returned by this endpoint count towards the Project-level `Tweet cap`.
Parameters ¶
query : str
One query for matching Tweets. Up to 1024 characters.
end_time : Union[datetime.datetime, str]
YYYY-MM-DDTHH:mm:ssZ (ISO 8601/RFC 3339). Used with ``start_time``. The newest, most recent UTC timestamp to which the Tweets will be provided. Timestamp is in second granularity and is exclusive (for example, 12:00:01 excludes the first second of the minute). If used without ``start_time``, Tweets from 30 days before ``end_time`` will be returned by default. If not specified, ``end_time`` will default to [now - 30 seconds].
max_results : int
The maximum number of search results to be returned by a request. A number between 10 and the system limit (currently 500). By default, a request response will return 10 results.
next_token : str
This parameter is used to get the next 'page' of results. The value used with the parameter is pulled directly from the response provided by the API, and should not be modified. You can learn more by visiting our page on `pagination`_.
since_id : Union[int, str]
Returns results with a Tweet ID greater than (for example, more recent than) the specified ID. The ID specified is exclusive and responses will not include it. If included with the same request as a ``start_time`` parameter, only ``since_id`` will be used.
start_time : Union[datetime.datetime, str]
YYYY-MM-DDTHH:mm:ssZ (ISO 8601/RFC 3339). The oldest UTC timestamp from which the Tweets will be provided. Timestamp is in second granularity and is inclusive (for example, 12:00:01 includes the first second of the minute). By default, a request will return Tweets from up to 30 days ago if you do not include this parameter.
until_id: string
Returns results with a Tweet ID less than (that is, older than) the specified ID. Used with ``since_id``. The ID specified is exclusive and responses will not include it.
References ¶
https://developer.twitter.com/en/docs/twitter-api/tweets/search/api-reference/get-tweets-search-all
Academic Research product track: https://developer.twitter.com/en/docs/projects/overview#product-track
Tweet cap: https://developer.twitter.com/en/docs/projects/overview#tweet-cap
pagination: https://developer.twitter.com/en/docs/twitter-api/tweets/search/integrate/paginate
func (*Client) SearchRecentTweets ¶
func (c *Client) SearchRecentTweets(query string, params Map) (*TweetsResponse, error)
The recent search endpoint returns Tweets from the last seven days that match a search query.
The Tweets returned by this endpoint count towards the Project-level `Tweet cap`.
Parameters ¶
query : str
One rule for matching Tweets. If you are using a `Standard Project`_ at the Basic `access level`_, you can use the basic set of `operators`_ and can make queries up to 512 characters long. If you are using an `Academic Research Project`_ at the Basic access level, you can use all available operators and can make queries up to 1,024 characters long.
end_time : Union[datetime.datetime, str]
YYYY-MM-DDTHH:mm:ssZ (ISO 8601/RFC 3339). The newest, most recent UTC timestamp to which the Tweets will be provided. Timestamp is in second granularity and is exclusive (for example, 12:00:01 excludes the first second of the minute). By default, a request will return Tweets from as recent as 30 seconds ago if you do not include this parameter.
max_results : int
The maximum number of search results to be returned by a request. A number between 10 and 100. By default, a request response will return 10 results.
next_token : str
This parameter is used to get the next 'page' of results. The value used with the parameter is pulled directly from the response provided by the API, and should not be modified.
since_id : Union[int, str]
Returns results with a Tweet ID greater than (that is, more recent than) the specified ID. The ID specified is exclusive and responses will not include it. If included with the same request as a ``start_time`` parameter, only ``since_id`` will be used.
start_time : Union[datetime.datetime, str]
YYYY-MM-DDTHH:mm:ssZ (ISO 8601/RFC 3339). The oldest UTC timestamp (from most recent seven days) from which the Tweets will be provided. Timestamp is in second granularity and is inclusive (for example, 12:00:01 includes the first second of the minute). If included with the same request as a ``since_id`` parameter, only ``since_id`` will be used. By default, a request will return Tweets from up to seven days ago if you do not include this parameter.
until_id : Union[int, str]
Returns results with a Tweet ID less than (that is, older than) the specified ID. The ID specified is exclusive and responses will not include it.
References ¶
Tweet cap: https://developer.twitter.com/en/docs/projects/overview#tweet-cap
Standard Project: https://developer.twitter.com/en/docs/projects
access level: https://developer.twitter.com/en/products/twitter-api/early-access/guide.html#na_1
operators: https://developer.twitter.com/en/docs/twitter-api/tweets/search/integrate/build-a-query
Academic Research Project: https://developer.twitter.com/en/docs/projects
func (*Client) SearchSpaces ¶
func (c *Client) SearchSpaces(query string, params Map) (*SpacesResponse, error)
Return live or scheduled Spaces matching your specified search terms
https://developer.twitter.com/en/docs/twitter-api/spaces/search/api-reference/get-spaces-search
func (*Client) SetDefaultOAuth ¶
TODO: Integrate this to get_request, for each request, see if the oauth method is default, set it!, but we need the caller function? or maybe we can call this function inside each method
func (*Client) UnBlock ¶
func (c *Client) UnBlock(target_user_id string) (*BlockResponse, error)
The request succeeds with no action when the user sends a request to a user they're not blocking or have already unblocked.
func (*Client) UnHideReply ¶
func (c *Client) UnHideReply(reply_id string) (*HideReplyResponse, error)
Unhides a reply to a Tweet
Parameters ¶
reply_id:
Unique identifier of the Tweet to unhide. The Tweet must belong to a conversation initiated by the authenticating user.
References ¶
func (*Client) UnMute ¶
func (c *Client) UnMute(target_user_id string) (*MuteResponse, error)
Allows an authenticated user ID to unmute the target user.
The request succeeds with no action when the user sends a request to a user they're not muting or have already unmuted.
func (*Client) UnRetweet ¶
func (c *Client) UnRetweet(tweet_id string) (*RetweetResponse, error)
Allows an authenticated user ID to remove the Retweet of a Tweet.
The request succeeds with no action when the user sends a request to a user they're not Retweeting the Tweet or have already removed the Retweet of.
Parameters ¶
tweet_id: The ID of the Tweet that you would like to remove the Retweet of.
References ¶
func (*Client) UnfollowList ¶
func (c *Client) UnfollowList(list_id string) (*FollowResponse, error)
Enables the authenticated user to unfollow a List.
func (*Client) UnfollowUser ¶
func (c *Client) UnfollowUser(target_user_id string) (*FollowResponse, error)
Allows a user ID to unfollow another user.
The request succeeds with no action when the authenticated user sends a request to a user they're not following or have already unfollowed.
func (*Client) Unlike ¶
func (c *Client) Unlike(tweet_id string) (*LikeResponse, error)
Unlike a Tweet.
The request succeeds with no action when the user sends a request to a user they're not liking the Tweet or have already unliked the Tweet.
Parameters ¶
tweet_id: The ID of the Tweet that you would like to unlike.
References ¶
func (*Client) UnpinList ¶
func (c *Client) UnpinList(list_id string) (*PinResponse, error)
Enables the authenticated user to unpin a List.
func (*Client) UpdateList ¶
func (c *Client) UpdateList(list_id string, name string, description string, private bool, params Map) (*UpdateListResponse, error)
Enables the authenticated user to update the meta data of a specified List that they own.
https://developer.twitter.com/en/docs/twitter-api/lists/manage-lists/api-reference/put-lists-id
type ComplianceJobResponse ¶
type ComplianceJobResponse struct { Data entities.ComplianceJob Includes IncludesEntity Errors []ErrorEntity Meta MetaEntity RateLimits RateLimits }
func (*ComplianceJobResponse) Parse ¶
func (r *ComplianceJobResponse) Parse(raw_response *http.Response) (*ComplianceJobResponse, error)
type ComplianceJobsResponse ¶
type ComplianceJobsResponse struct { Data []entities.ComplianceJob Includes IncludesEntity Errors []ErrorEntity Meta MetaEntity RateLimits RateLimits }
func (*ComplianceJobsResponse) Parse ¶
func (r *ComplianceJobsResponse) Parse(raw_response *http.Response) (*ComplianceJobsResponse, error)
type DeleteResponse ¶
type DeleteResponse struct { Data struct { Deleted bool `json:"deleted"` } Includes IncludesEntity Errors []ErrorEntity Meta MetaEntity RateLimits RateLimits }
func (*DeleteResponse) Parse ¶
func (r *DeleteResponse) Parse(raw_response *http.Response) (*DeleteResponse, error)
type ErrorEntity ¶
type FollowResponse ¶
type FollowResponse struct { Data struct { Following bool `json:"following"` } Includes IncludesEntity Errors []ErrorEntity Meta MetaEntity RateLimits RateLimits }
func (*FollowResponse) Parse ¶
func (r *FollowResponse) Parse(raw_response *http.Response) (*FollowResponse, error)
type HideReplyResponse ¶
type HideReplyResponse struct { Data struct { Hidden bool `json:"hidden"` } Includes IncludesEntity Errors []ErrorEntity Meta MetaEntity RateLimits RateLimits }
func (*HideReplyResponse) Parse ¶
func (r *HideReplyResponse) Parse(raw_response *http.Response) (*HideReplyResponse, error)
type IncludeGeo ¶
type IncludesEntity ¶
type LikeResponse ¶
type LikeResponse struct { Data struct { Liked bool `json:"liked"` } Includes IncludesEntity Errors []ErrorEntity Meta MetaEntity RateLimits RateLimits }
func (*LikeResponse) Parse ¶
func (r *LikeResponse) Parse(raw_response *http.Response) (*LikeResponse, error)
type List ¶
type List struct { ID string `json:"id"` Name string `json:"name"` CreatedAt time.Time `json:"created_at,omitempty"` Private bool `json:"private,omitempty"` FollowerCount int `json:"follower_count,omitempty"` MemberCount int `json:"member_count,omitempty"` OwnerID string `json:"owner_id,omitempty"` Description string `json:"description,omitempty"` }
type ListMemberResponse ¶
type ListMemberResponse struct { Data struct { IsMember bool `json:"is_member"` } Includes IncludesEntity Errors []ErrorEntity Meta MetaEntity RateLimits RateLimits }
func (*ListMemberResponse) Parse ¶
func (r *ListMemberResponse) Parse(raw_response *http.Response) (*ListMemberResponse, error)
type ListResponse ¶
type ListResponse struct { Data List Includes IncludesEntity Errors []ErrorEntity Meta MetaEntity RateLimits RateLimits }
func (*ListResponse) Parse ¶
func (r *ListResponse) Parse(raw_response *http.Response) (*ListResponse, error)
type ListsResponse ¶
type ListsResponse struct { Data []List Includes IncludesEntity Errors []ErrorEntity Meta MetaEntity RateLimits RateLimits CallerData CallerData Caller func(string, Map) (*ListsResponse, error) }
func (*ListsResponse) NextPage ¶
func (r *ListsResponse) NextPage() (*ListsResponse, error)
func (*ListsResponse) Parse ¶
func (r *ListsResponse) Parse(raw_response *http.Response) (*ListsResponse, error)
type Media ¶
type Media struct { MediaKey string `json:"media_key"` Type string `json:"type"` Url string `json:"url"` DurationMs int `json:"duration_ms,omitempty"` Height int `json:"height,omitempty"` NonPublicMetrics map[string]int `json:"non_public_metrics,omitempty"` OrganicMetrics map[string]int `json:"organic_metrics,omitempty"` PreviewImageUrl string `json:"preview_image_url,omitempty"` PromotedMetrics map[string]int `json:"promoted_metrics,omitempty"` PublicMetrics map[string]int `json:"public_metrics,omitempty"` Width int `json:"width,omitempty"` AltText int `json:"alt_text,omitempty"` }
type MetaEntity ¶
type MetaEntity struct { ResultCount int `json:"result_count"` NewestID string `json:"newest_id"` OldestID string `json:"oldest_id"` PreviousToken string `json:"previous_token"` NextToken string `json:"next_token"` }
*** Basic Entities *** //
type MuteResponse ¶
type MuteResponse struct { Data struct { Muting bool `json:"muting"` } Includes IncludesEntity Errors []ErrorEntity Meta MetaEntity RateLimits RateLimits }
func (*MuteResponse) Parse ¶
func (r *MuteResponse) Parse(raw_response *http.Response) (*MuteResponse, error)
type MutedUsersResponse ¶
type MutedUsersResponse struct { Data []entities.User Includes IncludesEntity Errors []ErrorEntity Meta MetaEntity RateLimits RateLimits CallerData CallerData Caller func(Map) (*MutedUsersResponse, error) }
func (*MutedUsersResponse) NextPage ¶
func (r *MutedUsersResponse) NextPage() (*MutedUsersResponse, error)
func (*MutedUsersResponse) Parse ¶
func (r *MutedUsersResponse) Parse(raw_response *http.Response) (*MutedUsersResponse, error)
type PinResponse ¶
type PinResponse struct { Data struct { Pinned bool `json:"pinned"` } Includes IncludesEntity Errors []ErrorEntity Meta MetaEntity RateLimits RateLimits }
func (*PinResponse) Parse ¶
func (r *PinResponse) Parse(raw_response *http.Response) (*PinResponse, error)
type Place ¶
type Place struct { FullName string `json:"full_name"` ID string `json:"id"` ContainedWithin string `json:"contained_within,omitempty"` Country string `json:"country,omitempty"` CountryCode string `json:"country_code,omitempty"` Geo IncludeGeo `json:"geo,omitempty"` Name string `json:"name,omitempty"` PlaceType string `json:"place_type,omitempty"` }
type PollOption ¶
type RateLimits ¶
type RateLimits struct { Limit int `json:"x-rate-limit"` Remaining int `json:"x-rate-limit-remaining"` ResetTimestamp int64 `json:"x-rate-limit-reset"` // Isn't this a time.Time? }
func (*RateLimits) Set ¶
func (r *RateLimits) Set(header http.Header)
type RetweetResponse ¶
type RetweetResponse struct { Data struct { Retweeted bool `json:"retweeted"` } Includes IncludesEntity Errors []ErrorEntity Meta MetaEntity RateLimits RateLimits }
func (*RetweetResponse) Parse ¶
func (r *RetweetResponse) Parse(raw_response *http.Response) (*RetweetResponse, error)
type SpaceResponse ¶
type SpaceResponse struct { Data entities.Space Includes IncludesEntity Errors []ErrorEntity Meta MetaEntity RateLimits RateLimits }
func (*SpaceResponse) Parse ¶
func (r *SpaceResponse) Parse(raw_response *http.Response) (*SpaceResponse, error)
type SpacesResponse ¶
type SpacesResponse struct { Data entities.Space Includes IncludesEntity Errors []ErrorEntity Meta MetaEntity RateLimits RateLimits }
func (*SpacesResponse) Parse ¶
func (r *SpacesResponse) Parse(raw_response *http.Response) (*SpacesResponse, error)
type SpecialError ¶
type SpecialError struct { Title string `json:"title"` Type string `json:"type"` Status int `json:"status"` Detail string `json:"detail"` }
func (*SpecialError) Error ¶
func (e *SpecialError) Error() error
type TweetResponse ¶
type TweetResponse struct { Data entities.Tweet Includes IncludesEntity Errors []ErrorEntity Meta MetaEntity RateLimits RateLimits }
*** Response Entities *** //
func (*TweetResponse) Parse ¶
func (r *TweetResponse) Parse(raw_response *http.Response) (*TweetResponse, error)
type TweetsCountResponse ¶
type TweetsCountResponse struct { Data struct { End time.Time `json:"end"` Start time.Time `json:"start"` TweetCount int `json:"tweet_count"` } Meta struct { // TODO: Also there is a "meta" field in the response that is a object TotalTweetCount int `json:"total_tweet_count"` NextToken string `json:"next_token"` } Includes IncludesEntity Errors []ErrorEntity RateLimits RateLimits }
func (*TweetsCountResponse) Parse ¶
func (r *TweetsCountResponse) Parse(raw_response *http.Response) (*TweetsCountResponse, error)
type TweetsResponse ¶
type TweetsResponse struct { Data []entities.Tweet Includes IncludesEntity Errors []ErrorEntity Meta MetaEntity RateLimits RateLimits CallerData CallerData Caller func(string, Map) (*TweetsResponse, error) }
func (*TweetsResponse) NextPage ¶
func (r *TweetsResponse) NextPage() (*TweetsResponse, error)
func (*TweetsResponse) Parse ¶
func (r *TweetsResponse) Parse(raw_response *http.Response) (*TweetsResponse, error)
type UpdateListResponse ¶
type UpdateListResponse struct { Data struct { Updated bool `json:"updated"` } Includes IncludesEntity Errors []ErrorEntity Meta MetaEntity RateLimits RateLimits }
func (*UpdateListResponse) Parse ¶
func (r *UpdateListResponse) Parse(raw_response *http.Response) (*UpdateListResponse, error)
type UserResponse ¶
type UserResponse struct { Data entities.User Includes IncludesEntity Errors []ErrorEntity Meta MetaEntity RateLimits RateLimits }
func (*UserResponse) Parse ¶
func (r *UserResponse) Parse(raw_response *http.Response) (*UserResponse, error)
type UsersResponse ¶
type UsersResponse struct { Data []entities.User Includes IncludesEntity Errors []ErrorEntity Meta MetaEntity RateLimits RateLimits CallerData CallerData Caller func(string, Map) (*UsersResponse, error) }
func (*UsersResponse) NextPage ¶
func (r *UsersResponse) NextPage() (*UsersResponse, error)
func (*UsersResponse) Parse ¶
func (r *UsersResponse) Parse(raw_response *http.Response) (*UsersResponse, error)