Skip to content

MrKomodoDragon/gpu-hunter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gpu-stock-tracker

gpu-tracker is a simple stock tracker to keep track of the stock of GPUs.

Why was this made?

As I looked around sites for a gpu to buy, I noticed a lot of GPUs went out of stock quickly. I decided to automate the process of checking the sites for a gpu in stock with Python.

Setup

First install a couple of dependencies:

pip install notify-run discord-webhook

Then, clone the repo:

git clone https://github.com/MrKomodoDragon/gpu-tracker.git

Next, you can set up whatever products you would track and how you would like to be notified.

Adding a product to Track

To do this, change the url for the variable product_url in the stock.py file. You can add a single product, or a search result to keep track of multiple products that meet criteria you want to set based on the filters on the website itself.

You can also change the product name to customize the notifications, under product_name.

Setting up Email

To set up email, you should fill out the sender_email and reciever_email with your own email address first. Then, to fill out the smtp_server variable, check out this site to find the name of the SMTP server.

For gmail, you have to go to settings and turn on allow less secure apps access.

NOTE: This setting makes your account more vulnerable. I highly recommend creating another account for the email notifications for this reason. Even if you don't have to turn on this setting for other email providers, I still recommend creating a separate account so your main account doesn't get flooded with emails.

Setting up Discord Webhook

First, make a webhook.. Then, set the url variable in line 25 to the webhook url.

Setting up Notify-Run

So, in a terminal, first run notify-run register to get the channel link and subscribe on the all the devices you would like to receive notifications on.

Customizing the Notifications

So, to customize the notifications, just edit product_name.

Automating the Checker

You could manually run the script to check the stock, but why not automate it instead?

Linux and OS X

Run crontab -e in the terminal.

This will use launch vim or vi, press i to enter insert mode to start editing. Then, add the following line to the bottom of the page:

* * * * * python3 /path/to/stock.py

Windows

Follow this guide to schedule the script every minute on windows.

Todo

  • Add a separate config file
  • Add support for multiple urls so you can track multiple models of the 1660 super, for example. Update: Support for multiple URLs was added in commit 20dd97e1f33f6796386e9764de34729998454ba3