Git Product home page Git Product logo

kareemelgendy / restock-bot Goto Github PK

View Code? Open in Web Editor NEW
23.0 2.0 2.0 21.12 MB

Basic Python script that leverages public endpoints on Shopify stores to track out-of-stock products and attempt to purchase them the moment they become available and update users through SMS using the Twilio API.

Python 100.00%
python shopify twilio-sms-api ecommerce requests webscraping sneakerbot bots script sneakermonitor

restock-bot's Introduction

Restock Bot

A basic Python script that will scrape e-commerce websites powered by Shopify and periodically check for a product restock and update the user through SMS using the Twilio API or automatically attempt to purchase the item(s) being watched the moment they become available.

Important

  • Make sure /products.json is accessible
  • Enter Twilio API credentials in an .env file for SMS notifications

Checkout Testing

Shopify checkout test cases:

  • Declined message - 4000000000000002
  • Incorrect number - 4242424242424241
  • Disputed transaction - 4000000000000259
  • Invalid Expiry Month - 12 < XX
  • Invalid Expiry Year - past year
  • Invalid CVV - any 2 digits

Getting Started

  1. Clone the repo
$ git clone https://github.com/kareemelgendy/restock-bot.git
  1. Create and activate virtual environment

    Install virtualenv: sudo pip install virtualenv if needed

$ cd restock-bot
$ virtualenv env
$ source env/bin/activate
  1. Create an .env file for the Twilio SMS API keys (if using SMS)
$ touch .env
$ source .env
  1. Install the required modules
$ pip install -r requirements.txt
  1. Enter profiles (if any) in data/profiles.json and products in data/products.json
    • Profiles are only used for product checkout if opted for

Example Profile:

"John Doe": {
	"First Name": "John",
	"Last Name": "Doe",
	"Email": "[email protected]",
	"Address": "23 Jump St.",
	"Address 2 (optional)": "",
	"City": "Toronto",
	"Province": "Ontario",
	"Country": "Canada",
	"Postal Code": "M5V 3L9",
	"Phone Number": "6471231234",
	"Payment": {
      "Card Number": "123456789012",
		"Name": "John Doe",
		"Expiry Date (MM/YY)": "12/34",
		"CVV": "123"
	}
}

Example Product:

  • If an item has multiple sizes and/or colours fill accordingly, otherwise keep the fields blank
    • Clothing: size (required), colour (optional)
    • Footwear: size (required), colour (optional)
    • Accessories: size (not applicable), colour (not applicable)
  • Fill Phone field if you wish to be notified by SMS
  • Fill Profile field with a valid profile if you want to attempt to checkout

**If both Profile and Phone fields are filled, Profile will take precendence

{
	"Product URL": "https://ca.octobersveryown.com/collections/t-shirts/products/ss22-bubble-owl-t-shirt-black",
	"Size": "M",
	"Colour": "",
	"Profile": "John Doe",
	"Phone": ""
}
  1. After entering profiles and products, run the following:
python main.py

Disclaimer

The developer of this software should not be held liable for any lost opportunities resulting from its usage.

restock-bot's People

Contributors

dependabot[bot] avatar kareemelgendy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

restock-bot's Issues

issue not checking out

smokeandmirrorshobby.com
product adds to cart (just using yugioh blazing vortex booster box to test as its in stock.
already logged in
gets to end but doesn't hit the button pay now.
any thoughts?

just some inspection
/button class=c0fok_32pNS" aria-busy
html body div#app.FullHeightApp section._1CoOG div._3d-Au div._3N6iG div._39SW-._2dQzu._160BV.ioQcb div._39SW-._3IT_5 button.cOfoK._32pNS
.cOfoK
/html/body/div/section/div[1]/div[2]/div[3]/div[2]/button
/html/body/div/section/div[1]/div[2]/div[3]/div[2]/button

Discord

Se puede conectar con discord?

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.