This is a simple Python script that uses OpenAI's Chat API to generate tweets and post them to a Twitter account. Before you run this script, make sure to follow these steps:
- Set up a Twitter Developer account and create a new app: https://developer.twitter.com/en/apps
- Get the API keys and access tokens for your Twitter app
- Install the necessary libraries (
tweepy
andopenai
) using pip:pip install tweepy
pip install openai
- Set it and forget it with a cron job
I use this script for a Twitter account called Reel Riddles that posts riddles about scenes from popular movies. The script itself works great but the prompt could use some engineering. Have fun!