Last updated
Last updated
The following example requires the tweepy
library.
Get a Twitter API key and secret from .
The following agent will use Twitter to get information about a user, send a message to a user, and create a new tweet.
cookbook/tools/twitter_tools.py
bearer_token
str
None
The bearer token for Twitter API authentication
consumer_key
str
None
The consumer key for Twitter API authentication
consumer_secret
str
None
The consumer secret for Twitter API authentication
access_token
str
None
The access token for Twitter API authentication
access_token_secret
str
None
The access token secret for Twitter API authentication
create_tweet
Creates and posts a new tweet
reply_to_tweet
Replies to an existing tweet
send_dm
Sends a direct message to a Twitter user
get_user_info
Retrieves information about a Twitter user
get_home_timeline
Gets the authenticated user’s home timeline