https://github.com/joebb10/auto-tweet-generator
This code is a Flask app that uses OpenAI and X APIs to generate and post tweets automatically based on user-defined prompts.
https://github.com/joebb10/auto-tweet-generator
api automation bot tweepy tweepy-bot twitter twitter-api twitter-bot
Last synced: 11 months ago
JSON representation
This code is a Flask app that uses OpenAI and X APIs to generate and post tweets automatically based on user-defined prompts.
- Host: GitHub
- URL: https://github.com/joebb10/auto-tweet-generator
- Owner: joebb10
- Created: 2024-03-31T20:57:20.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-03-31T21:03:08.000Z (over 2 years ago)
- Last Synced: 2025-03-17T23:40:32.627Z (over 1 year ago)
- Topics: api, automation, bot, tweepy, tweepy-bot, twitter, twitter-api, twitter-bot
- Language: Python
- Homepage:
- Size: 3.91 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Auto-Tweet-Generator
This Flask-based application generates and posts tweets automatically using OpenAI's language model and the X API. It takes a prompt as input and generates a specified number of tweets per day for a given number of days. The generated tweets are then posted to the connected Twitter account.
# Usage:
- Install the required dependencies using pip install -r requirements.txt.
- Run the Flask application using python app.py.
- Send a POST request to /generate-tweet endpoint with the following JSON payload:
{
"prompt": "Your prompt text here",
"quantity_per_day": 5, // Number of tweets to generate per day
"days": 7 // Number of days to generate tweets for
}
- The application will generate the specified number of tweets per day based on the provided prompt and post them to the linked X account.
- Note: Ensure that the necessary API keys are securely configured and kept confidential.
# Dependencies:
- Flask
- Flask-CORS
- OpenAI
- Tweepy
# API Keys:
- OpenAI API Key
- X API Key (Consumer Key, Consumer Secret, Access Token, Access Token Secret)
# Contributing:
Contributions are welcome! Feel free to open an issue or submit a pull request.
# License:
This project is licensed under the MIT License.