The Twitter Automation Tool is a GUI-based application built using tkinter
, designed to automate various Twitter actions such as liking, retweeting, commenting, following accounts, and more. It allows users to perform these actions based on tweet links, keywords, and user accounts. Additionally, it provides features like paraphrasing content using Google's Gemini AI model and posting tweets with optional image attachments.
- Automate Twitter actions: Like, Retweet, Comment, Follow, Report, etc.
- Supports CSV file upload for batch processing of actions.
- Use Google's Gemini AI for paraphrasing comments or messages in multiple languages.
- Option to set delay time between automated actions.
- Supports posting tweets with messages and image attachments.
- main.py: The main application file that initializes the GUI and handles all functionalities.
- utils.py: Contains utility functions such as loading CSV files, finding tweets, and creating reports.
- actions.py: Manages the execution of Twitter actions like posting tweets, liking, retweeting, and more.
Before running this application, ensure you have the following:
- Python version: 3.12.4
- Google API key for using the Gemini AI model (replace
GOOGLE_API_KEY
inmain.py
). - ChromeDriver for WebDriver automation (automatically installed using
webdriver-manager
).
-
Clone the repository:
git clone https://github.com/hammadali1805/twitter-automation-tool.git cd twitter-automation-tool
-
Install the required dependencies:
pip install -r requirements.txt
-
Make sure you have ChromeDriver installed. You can download it here, or the script will install it for you using
webdriver-manager
. -
Replace the placeholder Google API key in
main.py
with your own:GOOGLE_API_KEY = "your_google_api_key"
-
Run the
main.py
file to start the application:python main.py
-
Main Tabs:
- Tweet Link Actions: Perform actions based on tweet links provided in a CSV or manually entered.
- Keyword Actions: Perform actions based on keywords found in tweets.
- Account Actions: Automate actions related to specific accounts (follow, message, report).
- Post Tweet: Post tweets with or without images.
-
Supported Actions:
- Like
- Retweet
- Comment (with multilingual paraphrasing option)
- Follow accounts
- Message accounts (with multilingual paraphrasing option)
- Report tweets or accounts
- Post tweets
The required Python packages are listed in requirements.txt
. Some notable dependencies include:
tkinter
: For GUI development.google-generativeai
: For using Google's Gemini AI model to paraphrase content.Pillow
: For handling images in the GUI.webdriver-manager
: For managing ChromeDriver installation.
To use Gemini AI, you'll need a valid Google API key. Update the following line in main.py
with your key:
GOOGLE_API_KEY = "your_google_api_key"
-
Icons and Logos:
- Replace the Twitter favicon by updating the
self.iconbitmap('twitter.ico')
line in themain.py
. - Replace the Twitter logo by providing your logo path in the line:
logo = Image.open("twitter.png")
.
- Replace the Twitter favicon by updating the
-
Actions: You can customize the actions in the
perform_action()
function in themain.py
file, which handles automating Twitter actions based on the selected parameters.
- Ensure proper API rate limits when using the Google Generative AI or the Twitter API to avoid timeouts or temporary bans.
- If ChromeDriver is not properly installed, ensure the
webdriver-manager
installs the correct version compatible with your Chrome browser.
This project is open-source and available under the MIT License.
Feel free to contribute by creating pull requests or submitting issues to improve this project!