A little tool that will send an email whenever the Bishop Cidercade in Dallas, TX updates its selection of drinks on tap.
-
crawler
for scraping the Cidercade website -
mongoose
to access a MongoDB database hosted on mLab to serve as a persistent store for the on-tap selection. -
nodemailer
for sending out email alerts -
Heroku for hosting and scheduling the job.
- Set up a new Gmail for sending out alerts. Use a password you don't care about.
- Go to your new Gmail account's Security page, scroll to the Less secure app access section, and enable Allow less secure apps.
- Create a new MongoDB database with a user that has read/write access, and retrieve the new URI. This should be of the format
mongodb://<db_username>:<db_password>@ds123456.mlab.com:12345/<db_name>
.- For instructions on how to do this in mLab, read the mLab docs and follow steps 1-3.
- Clone this repository using
git clone https://github.com/BenDMyers/Cidercade_OnTap_Alerter.git
. - Navigate inside the repository in your terminal.
- Install npm dependencies by running
yarn install
.- If you don't have Yarn, install it at yarnpkg.com.
When running the code locally in a development
build, the project looks to config/keys_dev.js
for important configuration values. However, these are tokens that should never be committed into version control. As a result, you'll have to create this file yourself.
config/keys_dev.js
module.exports = {
mongoUri: 'PUT THE MONGODB DATABASE URI YOU GOT EARLIER HERE',
outboxAddress: 'THE FIRST PART OF YOUR NEW GMAIL (BEFORE THE `@`)',
outboxPass: 'THE PASSWORD FOR YOUR NEW GMAIL',
receiverAddress: 'THE EMAIL ADDRESS THAT WILL RECEIVE THE ALERTS'
}
In a production
build, this project will instead get the above values from its environment variables. Set the env variables MONGO_URI
, OUTBOX_ADDRESS
, OUTBOX_PASS
, and RECEIVER_ADDRESS
, corresponding to the same values as above.