Since the launch of Nvidia RTX 30 series, normal buyer and pc enthusiast community is having a hard time getting their hand on one of these cards. The problem we face is combinational of multiple events like manufacturing supply chain issues, stockpile shortage and scalpers. The listing on Amazon is going to be out of stock in a few minutes after every restock of the cards.
As a fustrated buyer, or a person who fustruated of missing out a great card, I search for solutions to help myself order one of the card off Amazon. The immediate idea is to get myself informed when the the stock is available on Amazon. Lurking around github and I found a project that will help me to achieve this goal. It is AmazonMonitor by SpikeHD.
- Some programming experience with git and node.
- A running server/pc with nodejs and git related tools.
- A discord server (free).
The setup for this article I have tested is a Windows host running a VirtualBox of Ubuntu 20.04. The NodeJs server should runs fine on MacOs but there is no guarantee on Windows.
We will run a NodeJs server to actively crawling amazon page and record their price. Once the price drop or the stock become available, it will notify Discord server to make the bot send out message to Discord Client. Users at the discord client will be alerted with link to add product into their card. A simple chart visualization is as follow:
While SpikeHD doing a great job for the project, at the time of writing this article, serveral parts of the code is not working, I have fork it and did some fix on my repository https://github.com/kai101/AmazonMonitor
First thing first, make sure you have the basics of NodeJs related tools installed. For this article, we will be using nvm for NodeJs version management, npm for NodeJs package management. The system was tested on NodeJs 12.2, make sure you have this version or something higher than this. Below is an example if you use nvm to manage your node version
# if you use nvm to manage your node verisonnvm install 12.2
nvm use 12.2
Next clone the repository to your server/local.
git clone https://github.com/kai101/AmazonMonitor.git
Then install NodeJs modules.
Now you will need to copy the example configuration
# copy config.example.json and name it config.json
cp config.example.json config.json
For most part of the configuration, I would advice you to leave them as default. You are only required to fill in token field in the configuration with discord bot token.
How do we get the token for discord bot? We are going to create our own bot.
Head over to https://discord.com/developers/applications . Login and create a new application with any name you like.
Next go to the bot tab on the left and then click on add bot.
After adding the bot, you will see the token field.
Click on copy then then fills in the config.json as follow.
Now we are done for NodeJs configuration, head back to discord bot page. Click on OAuth2 Tab on the left, then tick the bot scope in the scope section and then tick the Administrator permission in the bot permission. Since we are using this bot for our own channel only, it is ok we give it a Admin permission.
Now, click on the copy button and paste it into your browser. You should be prompt to add the bot to your discord channel. If you don’t have any discord server go ahead and create it from your discord desktop/web/mobile client.
Now you show see the bot added to your server. Now lets get the bot running:
It is not over yet, this one last step to tell your bot which link they should be watching.
Go to your discord server channel and type in the chat with the link to the product your want to watch. For this example we are going to watch over Zotac RTX 3080 trinity:
The bot will response with a message similar to the following picture:
Now we are done !!! Sit back and wait for the notification when the product is available. This should give us a good time window to checkout the product before it runs out of stock.
If you like this article please give it a clap.