Skip to content

Slack Bot to post daily menu of restaurants

License

Notifications You must be signed in to change notification settings

IngoAlbers/lunch_buddy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

3b0b7df · Jan 12, 2018
Jan 12, 2018
Aug 13, 2017
Sep 27, 2017
Aug 13, 2017
Oct 16, 2017
Jul 4, 2017
Jul 4, 2017
Jan 12, 2018
Jul 4, 2017
Jul 4, 2017
Aug 13, 2017
Aug 23, 2017
Aug 30, 2017
Aug 13, 2017
Jul 15, 2017
Jan 12, 2018
Oct 4, 2017
Jul 18, 2017
Oct 11, 2017
Oct 4, 2017
Aug 20, 2017
Oct 4, 2017
Jul 12, 2017
Jul 15, 2017
Nov 10, 2017
Jul 15, 2017
Aug 13, 2017
Aug 13, 2017

Repository files navigation

Lunch Buddy

A Slack bot, that posts chat messages containing the daily menus of specific restaurants every day.

Requirements

This application uses slack-ruby-client to integrate the slack bot. Follow their instructions on how to set it up.

You need to set the environment variable SLACK_API_TOKEN.

Installation

This application uses whenever for the cron job setup. To set up the cron jobs run:

whenever --update-crontab

Make sure that cron has access to the required environment variable SLACK_API_TOKEN.

Contributing

If you want to add a new restaurant you only need to:

  1. Create the model:

app/models/restaurant/new_restaurant.rb

  1. Let it inherit from BaseRestaurant
module Restaurant
  class NewRestaurant < BaseRestaurant
    def get_contents(date); end
  end
end
  1. Implement the get_contents(date) method. It should return an array of strings containing the menus of the day.
def get_contents(date)
  date.friday? ? ['Fisch'] : ['Schnitzel', 'Moules et frites']
end

See app/models/restaurant/lilly_jo.rb for a working example.

In general any contribution is appreciated. To do so just:

  1. Fork the repository
  2. Create a branch (git checkout -b new-branch)
  3. Commit your changes (git commit -am 'Add great new thing')
  4. Push to the branch (git push origin new-branch)
  5. Create new Pull Request