Coder Social home page Coder Social logo

shaneabara / d3stryr-3stripes Goto Github PK

View Code? Open in Web Editor NEW

This project forked from thenikedestroyer/d3stryr-3stripes

0.0 2.0 0.0 3.53 MB

Python 3 implementation of d3stryr-3stripes

License: GNU General Public License v3.0

Python 32.78% JavaScript 4.47% HTML 62.75%

d3stryr-3stripes's Introduction

d3stryr-3stripes

Python 3 implementation of d3stryr-3stripes

Questions/Problems/Lurking: http://bit.ly/d3stripesQA

Requirements:

  1. Python 3.5.2 - https://www.python.org/downloads/

    Required modules: selenium, requests, virtualenv (optional - but is used in the instructions)

    If you don't have virtualenv and want to be able to follow the directions completely then install it with:

    pip3 install virtualenv
    

    If you don't have pip3 already installed then install it with (assuming you have Python 3.5.x installed):

    easy_install-3.5 pip
    
  2. chromedriver - https://sites.google.com/a/chromium.org/chromedriver/

    Neededed to drive Chrome. Download the appropriate version for your OS.

    Windows users: place the chromedriver.exe file in the bin folder OR in C:\Windows folder.

    Mac/Linux users: place the chromedriver file in the bin folder.

Installing:

  1. Either use git to clone this repository or click on "Download Zip"

  2. Navigate to the d3stryr-3stripes or d3stryr-3stripes-master folder depending on what you did in step 1.

    I will assume that if you are using git clone then you already know how to navigate to the appropriate folder. For everyone else, unzip d3stryr-3stripes-master.zip. Then move the folder into your home directory. Then open up a terminal window and type the following to navigate to the d3stryr-3stripes-master folder:

    cd d3stryr-3stripes-master
    
  3. Create a virtual environment (only needs to be done once per install):

    virtualenv -p python3 --no-site-packages env
    
  4. Activate the virtual environment (needs to be done for once for an active session in your terminal):

    Mac/Linux:

    source env/bin/activate
    

    Windows:

    env\Scripts\activate
    
  5. Install the requirements (needs to be done once per install):

    pip3 install -r requirements.txt
    

That is all that is needed to install.

Configuring:

The only file that needs to be modified is config.cfg.sample. Rename it to config.cfg and read CONFIG.md

Running

If you are starting from a new terminal and the d3stryr-3stripes-master folder is in your home directory then navigate (change into) the d3stryr-3stripes-master folder:

cd d3stryr-3stripes-master

Make sure you have activated the virtual environment:

Mac/Linux:

source env/bin/activate

Windows:

env\Scripts\activate

Then you are ready to run:

Mac/Linux:

./destroyer/destroyer.py

Windows:

.\destroyer\destroyer.py

Program Flow

  • The script will look up the either the Variant endpoint for inventory or the Client endpoint for inventory (or it may do both - with Client stock being used for the remainder of the run).
  • The script will cycle through your size list and check to see if inventory value is greater than 0.
  • If inventory is available it will attempt to cart that size.
  • If processCaptcha = True then the script will attempt to get a captcha token.
  • The script then builds the payload for the necessary add-to-cart request.
  • If the response is successful then the script will open up a Chrome browser and attempt to transfer the session over.
  • Chrome will try to access the main locale page first. Then waits several seconds and then navigates to the Cart-Show page.
  • If you get an empty Cart-Show page but the basket in the upper-right has a "1" showing then refresh the page once using (CTRL-R or CMD+R)
  • If nothing appears then quit the browser and move on to the next pair because any further refreshing will result in a soft-ban.

To-Do List

  • Interface w/ a MySQL DB for token harvesting locally.

Not-Gonna-Do List

  • Auto-checkout. I much prefer 10,000 people getting a pair versus 1,000 people getting 10 pairs.

Common Problems

  • If the command pip3 install virtualenv does not work then you will need to install pip3. More than likely the command will be:

    easy_install pip3
    

    or

    easy_install pip
    

    If that doesn't work then Google "how to install pip3 python3" for your OS.

  • If you get a browser window with "data;" as the URL then you will need to download the latest chromedriver version for your OS. See the instructions at the top of this README.

Common Curiosities

  • Variant Inventory vs. Client Inventory - Client inventory provides the latest inventory for a given product (provided that the clientId is correct). The variant inventory does not reflect the latest inventory numbers - it has been observed to reflect the inventory on product release.

d3stryr-3stripes's People

Contributors

thenikedestroyer avatar banditarmy avatar saromleang avatar rasulsafa avatar

Watchers

James Cloos avatar Almighty Omni avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.