This project is a social media bot designed to automate likes, comments, and other interactions on LinkedIn posts using Puppeteer. It interacts with company posts, using credentials and other settings provided in the .env
file. The bot leverages Puppeteer stealth mode to avoid detection and simulates user activity on the LinkedIn platform.
Before running this project, ensure you have the following installed on your machine:
-
Clone the repository:
git clone https://github.com/AttockOffice85/node-websurfer.git
-
Navigate to the project directory:
cd node-websurfer
-
Go to backend
cd backend
3.1. Set up the environment variables:
Create a `.env` file in the root directory of the backend dir based on the `.env.example` file provided.
Example `.env` file:
```env
HEADLESS_BROWSER=true
NO_OF_COMPANY_POSTS=5
NO_OF_RANDOM_POSTS=5
NO_OF_BOTS=2
SERVER_PORT=8080
```
3.2. Install the required dependencies and run the backend server:
```bash
npm install
```
```bash
npm run dev
```
-
Go to frontend
cd frontend
4.1. Set up the environment variables:
Create a `.env` file in the root directory of the frontend dir based on the `.env.example` file provided.
Example `.env` file:
```env
REACT_APP_API_URL=http://localhost:8080/api
```
4.2. Install the required dependencies and run the frontend server:
```bash
npm install
```
```bash
npm run start
```
The following environment variables are required for the bot to function:
HEADLESS_BROWSER
: Puppeteer browser will not show up on screen if this variable is set to true.NO_OF_COMPANY_POSTS
: The number of company posts to interact with during each bot run.NO_OF_RANDOM_POSTS
: The number of posts on home to interact with during each bot run.NO_OF_BOTS
: Set the number of bots equal to the number of users defined in theusers-data.json
file.SERVER_PORT
: Set port to 8080.REACT_APP_API_URL
: Do not add '/' at the end of the backend URL.
http://localhost:3000 for frontend