AutoLinker is a Python-based automation tool for LinkedIn. It allows users to automate several LinkedIn actions, including sending connection requests, liking posts, and posting comments. This is achieved through Selenium and WebDriver. The tool is designed to improve efficiency and streamline interactions on the platform.
- Project Overview
- Prerequisites
- Installation
- Configuration
- Usage
- Project Architecture
- Contributing
- License
- Python 3.7+: AutoLinker requires Python 3.7 or higher.
- Dependencies: The required libraries are listed in
requirements.txt. You can install them usingpip install -r requirements.txt. - ChromeDriver: AutoLinker uses ChromeDriver to interact with the LinkedIn website. You need to download the appropriate ChromeDriver version for your Chrome browser and ensure it's in your system's PATH or specify its location. The
webdriver-managerpackage helps manage this automatically. - LinkedIn Account: A LinkedIn account is essential to use this tool.
-
Clone the repository:
git clone https://github.com/harshkasat/AutoLinker.git cd AutoLinker -
Install dependencies:
pip install -r requirements.txt
-
(Optional) Setup a virtual environment: It's recommended to use a virtual environment to isolate the project's dependencies.
python3 -m venv .venv source .venv/bin/activate # On Linux/macOS .venv\Scripts\activate # On Windows
The tool is configured via command-line arguments using the utils.py module's linkedin_args_parser() function. These arguments control which actions are performed and their limits.
The main script is app.py, which uses FastAPI to create a simple web server. However, the core LinkedIn automation logic resides in main.py. To run the automation:
-
Run the FastAPI server:
uvicorn app:app --reload
-
Call the automation endpoint: This endpoint triggers the LinkedIn automation. You'll need to pass the desired actions and limits as query parameters. For example, to send 5 connection requests and like posts with a scroll limit of 3:
curl http://127.0.0.1:8000/call_automate?send_connections=true&connection_limit=5&like_posts=true&like_scroll_limit=3
Replace
127.0.0.1:8000with your server's address and port if needed. You can also omit parameters to use default values. -
Command-line arguments (alternative): You can run the automation directly from the command line (without the FastAPI server) by executing
main.py. The command-line arguments are defined inutils.pyand are passed tomain.py. Example:python main.py -s -l -c --connection-limit 5 --like-scroll-limit 3 --comment-scroll-limit 2
-sor--send-connections: Send connection requests.-lor--like-posts: Like posts.-cor--comment-posts: Comment on posts.--connection-limit: Number of connection requests to send.--like-scroll-limit: Number of times to scroll down while liking posts.--comment-scroll-limit: Number of times to scroll down while commenting on posts.
The project is structured into several modules:
main.py: The main script that orchestrates the LinkedIn automation.utils.py: Contains the argument parser.LinkedinAutomationdirectory: Contains modules for specific LinkedIn actions (connections, likes, comments).app.py: FastAPI server for easier access to the automation.
Contributions are welcome! Please refer to the CONTRIBUTING.md file (if available) for guidelines.
This project is licensed under the MIT License - see the LICENSE file for details.
Note: This README is based on the provided code. A more comprehensive README would include details about error handling, logging, the structure of the LinkedinAutomation module, and more detailed usage examples. The comments_linkedin_posts.py file provides an example of how the commenting functionality works, showing the use of Selenium to interact with the webpage elements. Similar logic is likely used in the other modules within the LinkedinAutomation directory. Remember to handle potential exceptions and implement robust error handling in your automation scripts.