Funny tweets retweet bot.
- Generate your access token with the account you want to use the bot on
- Set the environment variables for the script
- Launch the script
The flow used from the script to generate the lifelong access token is called "3-legged OAuth flow". More info here
The following env variables should be populated:
OWNER_USER_ID=
API_KEY=
API_SECRET_KEY=
ACCESS_TOKEN=
ACCESS_TOKEN_SECRET=
GOOGLE_SERVICE_ACCOUNT=
The OWNER_USER_ID
is the unique identifier associated with the twitter account of the bot's owner. Find it using the script make get_twitter_user_id
and pasting the owner's twitter username.
Both the API_KEY
and API_SECRET_KEY
you'll find in the developer twitter portal of your account.
To generate the access tokens, instead, use the script make generate_token
.
After launching the script, open the url in the terminal, give authorization to the app to use the account, and extract the oauth_verifier
from the params of the url you get redirected to.
It's not the cleanest method, but it gets the job done. Feel free to suggest improvements or send a pr to make it better!
Note: For more info find the official docs at this link.
The GOOGLE_SERVICE_ACCOUNT
should be the copy-paste of the google service account which has access to the firestore instance used for the bot.
- Extract potential retweets
- re-tweet one
- save retweeted in list to avoid duplicates
The retweets candidates will be, in order:
- owner's mentions of the bot's account
- liked tweets
- followed accounts (must only be 100% jokes accounts)
Out of the full list of the retweets candidates, it's going to choose the tweet with the highest relevance based on the rateo of tweet likes to users followers.
- Post more than 1 tweet based on categories (eg. Daily, or from the Liked Tweets)