The project consists of a Python script that interacts with the OpenAI API to fetch tweet text generated by the GPT-3.5 model. It then uses the Tweepy library to communicate with the Twitter API and post the generated tweets.
- Generates philosophical and thought-provoking tweets using the GPT-3.5 model.
- Posts tweets automatically to Twitter using the Twitter API.
- Customizable prompts and configurations to create unique tweets.
Check out the tweets from the bot on Twitter: @FerideNice
- Python 3.7 or higher
- Clone the repository:
git clone https://github.com/cnrkaya/gpt-twitter-bot.git
- Install the required dependencies:
pip3 install -r requirements.txt
- Set up your environment variables:
Open a terminal and export your environment variables using the following commands, replacing your_value with your actual values:
export OPENAI_API_KEY=your_openai_api_key
export TWITTER_API_CONSUMER_KEY=your_twitter_consumer_key
export TWITTER_API_CONSUMER_SECRET=your_twitter_consumer_secret
export TWITTER_API_BEARER_TOKEN=your_twitter_bearer_token
export TWITTER_API_ACCESS_TOKEN=your_twitter_access_token
export TWITTER_API_ACCESS_TOKEN_SECRET=your_twitter_access_token_secret
Run the script:
python3 philo_bot_tweet.py
Medium Paper: ChatGPT API ile Kolayca Twitter Botu Oluşturma