This small Ruby application utilizes webscraping in order to fetch the current lunch menu for Chalmers Express, and sends a daily message in Slack informing about todays choises.
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.
To get upp and running clone the repository and install all the dependencies using bundle install
Then create a .env file containing the webhook link WEBHOOK = https://...
You will also need to have google chrome installed on your device and a supported ChromeDriver. Easily install the ChromeDriver from chromedriver.chromium.org/downloads
You are now set and ready to run rackup
in the terminal. Then navigate to http://localhost:REPLACE_WITH_PORT_GIVEN_WHEN_STARTING_THE_SERVER/send_menu
to trigger the webscraping event.
To get the current container from main run
$ docker pull adr29truck/expressscraper:latest
or for the current dev container
$ docker pull adr29truck/expressscraper:dev
Or build it manually by first cloning this repo.
To run the container you can use the following command
$ docker run --rm --tty -d -p 9000:4244 -e PORT=4244 -e RACK_ENV=production -e WEBHOOK=REPLACE_WITH_WEBHOOK_URL --name expressscraper expressscraper:REPLACE_WITH_TAG
To deploy the dockercontainer to Heroku use the following commands
$ docker tag expressscraper:latest registry.heroku.com/APP_NAME/web
$ docker push registry.heroku.com/APP_NAME/web
$ heroku container:release web -a APP_NAME