A Slack bot, that posts chat messages containing the daily menus of specific restaurants every day.
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
.
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
.
If you want to add a new restaurant you only need to:
- Create the model:
app/models/restaurant/new_restaurant.rb
- Let it inherit from
BaseRestaurant
module Restaurant
class NewRestaurant < BaseRestaurant
def get_contents(date); end
end
end
- 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:
- Fork the repository
- Create a branch (
git checkout -b new-branch
) - Commit your changes (
git commit -am 'Add great new thing'
) - Push to the branch (
git push origin new-branch
) - Create new Pull Request