create_tweet
- text (str): The text of the tweet. The Twitter character limit for a single tweet is 280 characters.
- poll_options (Optional[List[str]]): A list of poll options for a tweet with a poll.
- poll_duration_minutes (Optional[int]): Duration of the poll in minutes for a tweet with a poll. This is only required if the request includes poll_options.
- quote_tweet_id (Optional[Union[int, str]]): Link to the tweet being quoted.
quote_tweet_id
parameter or
the pair of poll_duration_minutes
and poll_options
parameters,
not both.
Reference:
https://developer.x.com/en/docs/x-api/tweets/manage-tweets/api-reference/post-tweets
delete_tweet
- tweet_id (str): The ID of the tweet to delete.
get_my_user_profile
get_user_by_username
- username (str): The username (handle) of the user to retrieve.
_get_user_info
- username (Optional[str], optional): The username of the user to retrieve. If None, the function retrieves the authenticated user’s profile information. (default: :obj:
None
)
_handle_http_error
- response (requests.Response): The HTTP response to handle.
TwitterToolkit
- TWITTER_CONSUMER_KEY: The consumer key for the Twitter API.
- TWITTER_CONSUMER_SECRET: The consumer secret for the Twitter API.
- TWITTER_ACCESS_TOKEN: The access token for the Twitter API.
- TWITTER_ACCESS_TOKEN_SECRET: The access token secret for the Twitter API.