-
Install Homebrew
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
-
Run brew update to make sure Homebrew is up to date
brew update
-
Add Homebrew’s location to your $PATH in your .bash_profile or .zshrc file
export PATH="/usr/local/bin:$PATH"
-
Install Node (npm will be installed with Node)
brew install node
-
Check your node version
node -v
-
Check your npm version
npm -v
Note: Node version should be greater than
10.0.0
and npm version should be greater than6.0.0
-
Install Chromium
brew cask install chromium
-
Install yarn
brew install yarn
-
clone this repo
git clone https://github.com/jbuck94/primenow.git
-
CD into the project directory
cd primenow
-
Install project dependencies
yarn install
-
Install PM2, a daemon process process manager that will keep your application online
yarn global add pm2
Rename secrets-example.json
to secrets.json
, and fill out the values.
NOTE: never check this file into version control
-
amazon: the
username
andpassword
is what you would use to log into amazon in your browser, this is so the script can get to your cart. -
mailjet: Follow this tutorial from Mailjet to setup an account and verify your domain. Once your account and domain are setup, click your name in the top right corner, then go to "API Key Management" and copy your API Key and Secret key into the config
-
notifications: the
send_to_email
is the address that will be notified upon finding delivery windows -
two_captcha_key: sign up for 2captcha account, and purchase captchas by clicking "add funds". Copy your API key from the "Account Settings" section on the dashboard
-
delivery_zip_code: the zipcode you will have your amazon order delivered to
The final step is to start the chron job, which will continually run in the background, every 5 minutes
pm2 run app.js
To check that the project is running, run
pm2 list
To see full metrics and logs, run
pm2 monit