Skip to content

A Slack "bot" for sending daily messages about what is served as lunch at Chalmers Express or in the Kårresturang if Express is closed.

Notifications You must be signed in to change notification settings

adr29truck/express_scraper

Repository files navigation

Express Scraper

Dev
RuboCopLintDev DockerHubPush UnitTests CodeFactor
Main
RuboCopLintMain DockerHubPush UnitTests CodeFactor

Table of Contents

About

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.

Getting Started

Without docker

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.

Using docker

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

Manually deploying to heroku

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

About

A Slack "bot" for sending daily messages about what is served as lunch at Chalmers Express or in the Kårresturang if Express is closed.

Resources

Stars

Watchers

Forks

Releases

No releases published

Contributors 4

  •  
  •  
  •  
  •  

Languages