ZYN Checker is a simple Node.js script that monitors the stock status of ZYN nicotine products from SnusDirect. It alerts you via a Telegram message when a product that was previously out of stock comes back in stock.
- Scrapes the SnusDirect website for product availability.
- Sends a Telegram alert when a specified product is back in stock.
- Tracks the stock status to avoid duplicate alerts.
- Ability to manually trigger stock checks and test alerts.
- Scheduled stock checks using cron (every 30 minutes by default).
- Node.js
- NPM
-
Clone this repository:
git clone <repository_url> zyn-checker
-
Navigate to the project directory:
cd zyn-checker
-
Install the dependencies:
npm install
-
Create a
.env
file and add your Telegram Bot Token and Channel ID:TELEGRAM_BOT_TOKEN=<Your Bot Token> TELEGRAM_CHAT_ID=<Your Channel ID>
node script.js --manual
node script.js --test
The script will automatically check the stock of your specified products every 30 minutes using node-cron
. No further action is needed after starting the script.
-
Products to Check: You can modify the products you want to monitor by editing the
productsToCheck
array inscript.js
.const productsToCheck = [ 'ZYN Black Cherry 3mg', 'ZYN Slim Violet Licorice Extra Strong' ];
-
Stock Alert: Modify the
sendTelegramMessage
function if you wish to customize the message sent to your Telegram channel.
This project is licensed under the MIT License.