Skip to content
This repository was archived by the owner on May 8, 2025. It is now read-only.

Riotcoke123/twitterbot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

X logo

Twitter Bot

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.

Features

  • 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.

New Features

  • Ability to read multiple tweets from a text file.
  • Each line in the text file is sent as a separate tweet.

Requirements

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

Setup

  1. Clone the repository:
  2. git clone https://github.com/Riotcoke123/twitterbot.git
  3. Navigate to the project directory:
  4. cd twitterbot
  5. Install required dependencies:
  6. pip install tweepy
  7. Fill in your Twitter API credentials in the script:
  8. 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'
  9. Specify the path to your text file with tweets:
  10. file_path = 'tweets.txt'
  11. Run the bot:
  12. python your_script.py

Usage

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.

Configuration

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

License

This project is licensed under the GNU GENERAL PUBLIC LICENSE. See the LICENSE file for more details.

Contributing

Contributions are welcome! Feel free to submit a pull request or open an issue for any bug reports or feature requests.

Author

Created by Riotcoke123. You can find more of my work on GitHub.

Links

About

Twitter Bot Made In Python Using Twitter API

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages