A Python-based automation tool for interacting with Pinterest, allowing users to upload pins from a CSV file while employing proxy rotation and user-agent handling to simulate human-like behavior.
- Automated Pin Upload: Upload multiple pins from a CSV file to specified Pinterest boards.
- Proxy Rotation: Utilize ZenRows to rotate proxies for making requests, ensuring stability and preventing IP bans.
- User-Agent Rotation: Randomly select user-agent strings to simulate different browser environments.
- Environment Variable Management: Load sensitive information such as API keys, email, and passwords from a
.envfile.
- Python 3.6+
python-dotenvfor loading environment variablespy3pinfor interacting with the Pinterest APIzenrowsfor proxy handlingrequestsfor making HTTP requests
-
Clone the repository:
https://github.com/DonaldWorlds/TshirtBusinessProject.git cd pinterest-bot -
Install required packages:
pip install python-dotenv py3pin zenrows requests
-
Set up your environment variables: Create a
.envfile in the root directory of the project with the following format:EMAIL=your_pinterest_email PASSWORD=your_pinterest_password USERNAME=your_pinterest_username CRED_ROOT=path_to_your_credentials_root ZENROWS_API_KEY=your_zenrows_api_key -
Prepare your CSV file: Create a CSV file named
pins.csvwith the following columns:board_id: The ID of the board to which the pin will be uploaded.image_path: The filename of the image (stored in theimagesdirectory).description: A description of the pin.title: The title of the pin.link: A link associated with the pin.
Example
pins.csvrow:board_id,image_path,description,title,link 939774715932751037,BrooklynUnitedStatesLiberty.png,HELLO EVERY ONE THIS IS MY FIRST PIN,Looking over the city,https://threadedretros.etsy.com
-
Add your images: Place your images in the
imagesdirectory.
-
Run the bot using the following command:
python main.py
This will log in to Pinterest and start uploading pins from the specified CSV file, using proxy rotation and random user-agent handling.
main.py: The main entry point of the application that initializes the PinterestBot and starts the upload process.pinterest_bot.py: Contains thePinterestBotclass that handles Pinterest interactions.proxy_handler.py: Manages proxy requests using ZenRows.user_agent_handler.py: Provides a method for retrieving random user-agent strings.
Feel free to fork the repository, make improvements, and submit pull requests. Any contributions or suggestions are welcome!
This project is licensed under Donald Witherspoon @2024