TweetGenAI is a Python-based bot designed to generate and post content automatically to X (formerly Twitter) using OpenAI's GPT models. It leverages the Twitter API for posting and is configurable to post at predefined intervals.
- Automated tweet generation using AI.
- Customizable posting intervals.
- Easy configuration through environment variables.
- Supports both text-based content generation and potential integration with other APIs for enriched content.
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.
- Python 3.6+
- Tweepy
- python-dotenv
- Clone the repository:
git clone https://github.com/jeffreyc2017/tweet-gen-ai.git
- Navigate to the project directory:
cd tweet-gen-ai
- Install the required packages:
pip install tweepy python-dotenv openai
- Create a
.env
file in the root directory with your Twitter API credentials and other configuration settings:
API_KEY=your_api_key_here
API_SECRET_KEY=your_api_secret_key_here
ACCESS_TOKEN=your_access_token_here
ACCESS_TOKEN_SECRET=your_access_token_secret_here
BEARER_TOKEN=your_bearer_token
OPENAI_API_KEY=your_openai_api_key
-
Modify
main.py
as needed to customize the tweet generation logic. -
Run the bot:
python main.py
To run the tests, execute the following command in the project directory:
python test.py
- Python - The programming language used.
- Tweepy - An easy-to-use Python library for accessing the Twitter API.
- python-dotenv - A Python library for managing environment variables.
Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.
We use SemVer for versioning. For the versions available, see the tags on this repository.
- Jeffrey Cai - Initial work - jeffreyc2017
This project is licensed under the MIT License - see the LICENSE.md file for details.