Skip to content

Latest commit

 

History

History
257 lines (136 loc) · 8.14 KB

README.md

File metadata and controls

257 lines (136 loc) · 8.14 KB

posh-a-matic

* welcome to the poshmark sharing app *

LinkedIn | Website | GitHub | Contact Info

Project Overview

This script is designed for users with a seller account on Poshmark marketplace.

Objectives:

poshamatic's primary functionalities include:

  • automated sharing of the listings for every item in your closet with all subscribers, or
  • automated sharing of all the listings of another Poshmark account.

 

Once the script is executed, it will share the requested listings every 120 minutes.

Note: You can edit the timing and other options if you desire.


 

Let the Share War Begin

Prerequisites

  • Python: v.3.5+
  • Firefox: v.69.0.1+
  • Selenium: v.4.11.0+
    • Note: For Safari, Selenium must be v.5+
  • Numpy: v.1.25.2+
  • webdriver_manager: v.4.0.0+
  • pyautogui: v.0.9.54+
  • logging: v.0.5.1.2+

 

To install Python3 requirements, you may run pip install -r requirements.txt.

You will also need a recent version of Firefox (or another webdriver of your choice).

  • If using Firefox, you will also likely need to install GeckoDriverManager, which on macOS can be accomplished using Homebrew with the command brew install geckodriver in terminal.
  • If using Edge, you will need to install EdgeChromiumDriverManager.

(back to top)


 

Setup

Git Clone:

First clone the repository in terminal:

  • git clone https://github.com/lyndskg/posh-a-matic

Change directories to enter the local repository:

  • cd posh-a-matic

(back to top)

User Credentials:

You will need to create a credentials.py file.

It is recommended to simply edit the example_credentials.py file and rename it.

poshmark_username = "poshmarkusername"
poshmark_password = "poshmarkpassword"

Edit the text in quotes to your actual username and password. Save the file and rename it credentials.py.

Assuming you are in the repo directory, the bash command would be mv example_credentials.py credentials.py .

 

(back to top)

Firefox and Other Web Drivers:

The default webdriver for this script is Chrome, which was the original web browser used in writing this script and executing the code.
From a development perspective Chrome offers a better interface to inspect the HTML code needed in writing the scraper.

 

However, other webdrivers, e.g. Safari, Firefox, and/or Edge may be used.

To learn more about setting up the appropriate web driver, visit the Selenium web driver documentation here.

(back to top)


 

Quick Start

Run in Terminal (Recommended):

In terminal run the following command: python share.py, which will run the script with the default options (see below).

Note: If you have several versions of python, you will need to amend the above line to run your python3 alias, e.g. python3 share.py.

(back to top)


 

Advanced Options

There are a variety of optional arguments for the script, including timing, closet scroll size, closet ordering, the account to share, and the webdriver.

To display the full range of command line arguments type python3 share.py --help or python3 share.py -help. For convenience, these options are described below.

Timing:

You can adjust the timing from the command line. The default is 7200 seconds (120 minutes or 2 hours).

Using a shorter time period is not recommended as it will be more likely caught by both captcha (I am not a robot) detection systems either at login or during the actual sharing.

Here are some examples:

  • Every four hours: python3 share.py -t 14400
  • Every two hours: python3 share.py -t 7200

(back to top)

 

Closet Size:

The latest version of this code will automatically scroll to the end of your active listings in your closet. You should no longer need to adjust the number of possible scrolls (default, n = 1000).  

If you desired to share only part of your closet, you could descrease the number of scrolls with the -n parameter:

python3 share.py -n 1

Note: The code above scrolls only 1 time.

(back to top)

 

Closet Ordering:

To preserve closet order, the closet items must be shared in their reverse order. To this end, the default sorting is order=True:

Preserve Closet Order:

  1. python3 share.py
  2. python3 share.py -o True

To override this option, you can reverse order the items of the closet with the following flag, -o False:

  • Reverse Original Closet Order: python3 share.py -o False

(back to top)

 

Account:

By default, the code will share all the listings for Poshmark account provided in credentials.py.

While you will still need your account information in credentials.py to login, you may request that the code share the listings of another Poshmark user with the account option: python3 share.py -a another_poshmark_closet.

This can be a useful feature, for example, in becoming a Poshmark ambassador.

Since the code is setup to run on a loop (by default every two hours), a safeguard is put in place to confirm that you actually want to share another users account.

This will appear in the terminal:

[*] you have requested to share
    the items in another poshmark closet:
    ------------------------------------
    [*]: another_poshmark_closet
    ------------------------------------


[*] to confirm this request, enter [y]
    to cancel and share your closet items instead enter [n] :
y

Note: This prompt will occur each time the code runs.

If you are confident you want to repeatedly share another users entire closet every few hours, you can bypass this prompt with the following command line option b True.

(back to top)

 

Random Sharing Subset:

If you would prefer to not share your entire closet (or another account's entire closet), you may select to share a randomly selected subset of items from all possible active items.

To do so, add the parameter -r followed by a number to your command in the terminal:
python3 share.py -a another_poshmark_closet -r 25

This shares 25 randomly selected items from another closet.

This functionality is helpful if you would like to share some of another person's closet, but not every item they have.

(back to top)

 

Webdriver:

Alternative Selenium web drivers may also be specified. Drivers may be called by entering their name, e.g. -d Firefox or -d Chrome or alternatively referring to the numerical shortcut for those options, e.g. -d 0 or -d 1.

The full list of driver names and options is as follows:

  • Chrome == 0
  • Safari == 1
  • Firefox == 2
  • Edge == 3

These must be properly installed on your system, otherwise you will encounter an error.

See here for further details.

(back to top)