Code Monkey home page Code Monkey logo

sneakerbot's Introduction

sneakerbot

CircleCI

Requirements

  • Environment with Java 8 installed
  • Valid chromedriver on your computer
  • Proxies with either no auth or user/password auth if you need them
  • A drop day that uses a splash page on Adidas
  • Patience

Setup *outline*

  • setup selenium chromdriver
  • package up jar
  • run
  • etc

Running

To run this, you need a few things. First, you'll need a copy of the config.xml, and the jar itself. Once you have those, put them somewhere and execute this command (modify to your use case)

java -Xms[INIT]M -Xmx[MAX]M -jar [jar] [config_file]

You can modify this command to suit your needs according to this list of values:

  • INIT: This is your starting heap size. Just replace the this with the number of MB you want to allocate.
  • MAX: This is the max heap size. Do the same as the starting heap size.
  • jar: The location of your JAR file (including extension).
  • config_file: The location of your bot configuration.

A configured starting command would look like this:

java -Xms1024M -Xmx4096M -jar sneakerbot.jar config.xml

Compiling

For compilation, we use Excelsior JET to compile to machine code. We use the Maven plugin to execute these tasks, and compiling is as simple as using the jet:build goal when running maven.

Proxies

Proxies are set up in the proxies.txt file. Currently, only user/pass and proxies without authentication are supported. If you need a different kind of authentication to be supported(such as ip), I suggest making a pull request and creating your own.

Formats are as follows:

  • No authentication: address:port
  • User/password: address:port:username:password

Configuration

There is a default configuration included with the JARs you can download, or you can create your own. An example configuration is as follows:

<?xml version="1.0" encoding="UTF-8"?>
<config>
    <mainUrl>http://www.adidas.com/</mainUrl>
    <splashUrl>http://www.adidas.com/yeezy</splashUrl>
    <cartUrl>https://www.adidas.com/on/demandware.store/Sites-adidas-US-Site/en_US/Cart-Show</cartUrl>
    <requestDelay>5000</requestDelay>
    <taskCount>50</taskCount>
    <chromeDriverPath>~/Downloads/chromedriver</chromeDriverPath>
    <useragent>Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3095.0 Safari/537.36</useragent>
    <selectors>
        <selector>[data-sitekey]</selector>
    </selectors>
    <onePass>false</onePass>
    <proxies>~/proxies.txt</proxies>
</config>

Configuration options:

  • mainUrl: This is used to set your default Adidas region
  • splashUrl: This is the SPLASH page address.
  • cartUrl: This is the link to view your cart once you've carted a product
  • requestDelay: This is how often the task should check if splash was passed
  • taskCount: How many tasks to run
  • chromeDriverPath: The location of your chromedriver file
  • useragent: The useragent string to use for requests
  • selectors: A list of HTML selectors to look for to verify that we passed splash.
  • onePass: Whether you want the bot to stop tasks after one instance passes splash [true/false]
  • proxies: The path to your proxies file including file extension.

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.