https://github.com/lmackenzie94/stock-checker
Checks the stock of Black Toe Running products.
https://github.com/lmackenzie94/stock-checker
aws node-cron pm2 puppeteer twilio-sms
Last synced: 2 days ago
JSON representation
Checks the stock of Black Toe Running products.
- Host: GitHub
- URL: https://github.com/lmackenzie94/stock-checker
- Owner: lmackenzie94
- Created: 2025-04-29T14:25:13.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-05-11T15:27:36.000Z (about 1 year ago)
- Last Synced: 2026-07-17T11:34:06.954Z (2 days ago)
- Topics: aws, node-cron, pm2, puppeteer, twilio-sms
- Language: JavaScript
- Homepage:
- Size: 24.4 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Black Toe Stock Checker
Checks the stock of Black Toe Running products, using
- `Puppeteer` (to scrape the website)
- `Twilio` (to send myself text messages)
- `Node.js` (to run the script)
- `PM2` (to manage the script)
- `node-cron` (to run the script at 10am and 6pm EST every day)
- a `.json` file of products to check
## Setup (on AWS EC2)
- SSH into the EC2 instance (`ssh -i "aws-ec2-lukes-macbook.pem" [instance Public DNS]`)
- update packages: `sudo apt update`
- upgrade packages: `sudo apt upgrade -y`
- clone the repo: `git clone https://github.com/luke-s-macbook/stock-checker.git`
- `cd stock-checker`
- install dependencies: `npm install`
- add `.env` file
- install Chromium browser (`sudo apt install -y chromium-browser`)
- install Puppeteer dependencies (see list [here](https://www.browserless.io/blog/puppeteer-on-aws-ec2))
- start the script with PM2: `pm2 start index.mjs --interpreter node --name "stock-checker"`
- save the PM2 config: `pm2 save`
- configure PM2 to start on boot: `pm2 startup`
### Helpful PM2 commands
- `pm2 list`
- `pm2 logs stock-checker`
- `pm2 stop stock-checker`
- `pm2 delete stock-checker`
## Deployment (to AWS EC2)
- `ssh -i "aws-ec2-lukes-macbook.pem" [instance Public DNS]`
- `cd stock-checker`
- `git pull`
- `pm2 restart stock-checker`