Git Product home page Git Product logo

e-commerce-notifier's Introduction

E-Commerce Notifier

This script scrapes e-commerce websites like Micro Center for a configurable set of products, then sends a notification when stock is found.

  1. Download and extract the Gecko Driver
  2. Set up a Twilio account and create an API key in the Programmable Messaging section.
    • Or set notifierType: PRINTLN (see step 3 below) to print out the URLs to stdout without sending SMS
  3. Create a file config.yaml with the following fields
# Path to geckodriver.exe from step 1
geckoDriver: C:\\Users\\Me\\Downloads\\geckodriver-v0.27.0-win64\\geckodriver.exe

# Twilio information from step 2
fromPhoneNumber: +15555555555
twilioAccountSid: <ENTER_ACCOUNT_SID>
twilioAuthToken: <ENTER_AUTH_TOKEN>

# The phone number(s) you want to send the text messages to
toPhoneNumbers: 
  - +15555555555
  - +15555555555

# (Optional) Range of time to wait (in milliseconds) between each round of website scrapes. Default 60000-900000
minDelay: 60000
maxDelay: 900000

# (Optional) Time to wait until selenium timeout on page load. Default 15000
pageTimeoutMs: 15000

# (Optional) Notifier types, e.g. TWILIO, PRINTLN. Default TWILIO only
notifiers:
  - type: TWILIO
    # The time between notifying for a particular item
    minumumInterval: 86400000
  - type: PRINTLN
    minimumInterval: 0
  - type: ANDROID
    minimumInterval: 43200000

# (Optional) Never notify about these product URLs
notificationBlacklist:
  - https://www.microcenter.com/product/631166/dell-alienware-aurora-r11-gaming-computer

# (Optional) Number of Firefox threads to spawn at once. Defaults to 2. Give -1 to have the same number of threads as URLs
threadCount: 2

# The product list pages to scrape. In this example, we're looking across 4 retailers for any RTX 3080 availability
productListUrls:
  - url: https://www.bestbuy.com/site/searchpage.jsp?_dyncharset=UTF-8&browsedCategory=abcat0507002&id=pcat17071&iht=n&ks=960&list=y&qp=gpusv_facet%3DGraphics%20Processing%20Unit%20(GPU)~NVIDIA%20GeForce%20RTX%203080&sc=Global&st=categoryid%24abcat0507002&type=page&usc=All%20Categories
  - url: https://www.microcenter.com/search/search_results.aspx?N=&cat=&Ntt=3080&searchButton=search&storeId=045
  - url: https://www.newegg.com/p/pl?N=100007709%20601357247
  - url: https://www.nvidia.com/en-us/shop/geforce/gpu/?page=1&limit=9&locale=en-us&category=GPU&gpu=RTX%203080&manufacturer=NVIDIA&manufacturer_filter=NVIDIA~1,ASUS~1,EVGA~2,GIGABYTE~2,MSI~1,PNY~0,ZOTAC~0
  - url: https://www.bhphotovideo.com/c/search?q=rtx%203080&filters=fct_category%3Agraphic_cards_6567

# The single product pages to scrape. Useful if a retailer's list page is terrible. That's NVidia...they're terrible.
productUrls:
  - url: https://www.nvidia.com/en-us/geforce/graphics-cards/30-series/rtx-3080/
  - url: https://www.nvidia.com/en-us/geforce/graphics-cards/30-series/rtx-3090/
  1. Run mvn clean install to build the project (install maven if you don't already have it)
  2. Run java -jar target/e-commerce-notifier-1.0-SNAPSHOT-jar-with-dependencies.jar -config <yaml_from_step_3> 5a. If you're using the ANDROID notifier, set GOOGLE_APPLICATION_CREDENTIALS="/path/to/privateKey.json" as an environment variable, and set up a Firebase default GCS bucket

Currently implemented retailers are:

  • Best Buy
  • Micro Center
  • Newegg
  • Nvidia
  • B&H Photo Video

Good luck, and happy purchasing!

Worst case........millions.

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.