
This project is a simple Twitter bot using Tweepy, a Python library for accessing the Twitter API. The bot can send tweets with a built-in rate limit of up to 50 tweets per 24 hours.
- Posts tweets using Twitter API v2.
- Rate-limited to a maximum of 50 tweets per 24-hour period.
- Automatically resets the tweet count after 24 hours.
- Reads tweets from a specified text file, sending each line as a tweet.
- Ability to read multiple tweets from a text file.
- Each line in the text file is sent as a separate tweet.
To use this bot, you will need:
- Python 3.7+ installed.
- Tweepy library (install it using
pip install tweepy
). - Twitter API credentials:
- API Key
- API Key Secret
- Bearer Token
- Access Token
- Access Token Secret
- Clone the repository:
- Navigate to the project directory:
- Install required dependencies:
- Fill in your Twitter API credentials in the script:
- Specify the path to your text file with tweets:
- Run the bot:
git clone https://github.com/Riotcoke123/twitterbot.git
cd twitterbot
pip install tweepy
API_KEY = 'your_api_key'
API_KEY_SECRET = 'your_api_key_secret'
BEARER_TOKEN = 'your_bearer_token'
ACCESS_TOKEN = 'your_access_token'
ACCESS_TOKEN_SECRET = 'your_access_token_secret'
file_path = 'tweets.txt'
python your_script.py
To send tweets from a file, ensure your tweets.txt
file is formatted with one tweet per line:
Hello, Twitter! This is my first tweet.
Today is a great day to code!
Check out my latest project.
The bot will automatically read and tweet each line in the file.
You can change the maximum number of tweets per 24-hour period by modifying the MAX_TWEETS_PER_DAY
variable in the script:
# Max number of requests allowed per day
MAX_TWEETS_PER_DAY = 50
This project is licensed under the GNU GENERAL PUBLIC LICENSE. See the LICENSE file for more details.
Contributions are welcome! Feel free to submit a pull request or open an issue for any bug reports or feature requests.
Created by Riotcoke123. You can find more of my work on GitHub.