/HappyLunch

A Slackbot to automatically crawl lunch menu from GiaChanhCamTuyet, take orders from team members, and submit an order on their website

Primary LanguageRubyMIT LicenseMIT

![Screenshots] (http://s21.postimg.org/v474g4o1j/Screen_Shot_2016_03_26_at_3_17_47_PM.png) ![Screenshots] (http://s30.postimg.org/hv1ccew29/Screen_Shot_2016_03_26_at_3_22_53_PM.png)

##Background

At MortgageClub, we have free catered lunch everyday. Previously, (1) our assistant would ask us what we want for lunch, (2) we then go to the restaurant website (giachanhcamtuyet, for example), (3) choose what we want to eat, (4) tell the assistant, and finally (5) she would place an order on the restaurant website.

We thought that we could create a Slackbot to automate all of these steps. So our team spent 2 days to code it up as a year-end fun project. We thought it might be useful to other engineering teams in Vietnam as well so we've made it public.

##How it works workflow

##Usage

Menu

  • Slack channel will receive today's menu in this format:
  1. Bò xốt tiêu xanh - bánh mì - 33000.0 VND
  1. Ba chỉ xào ruốc sả - 29000.0 VND
  2. Cá rô chiên giòn - 29000.0 VND
  3. Gà xào cari - 29000.0 VND
  4. Ếch xào lăn - 33000.0 VND
  • Every dish has a format: {item-number} {dish-name} - {price}

Place an order

Members use these command to place orders.

One dish #happylunch item-number.

  • Ex: #happylunch 1

Several dishes #happylunch item-number1,{space}item-number2,{space}item-number3.

  • Ex: #happylunch 1, 2, 3

##Install

FULLNAME='Nguyen Van A'
ADDRESS='93bis Nguyen Văn Thu, P. Da Kao, Q.1'
TELEPHONE=097990xxyy
EMAIL=nguyenvana@gmail.com
SLACK_TOKEN=xoxp-your-authentication-token-XXYY
OUTGOING_TOKEN=sk15-your-outgoing-token-XXYY
  • Set up a scheduler to call below rake tasks. You can choose your ideal time.
# 8:30 AM get menu from GiaChanhCamTuyet & send menu to Slack
rake slack:get_menu

# 9:00 AM remind members who haven't ordered lunch
rake slack:remind_members_order_lunch

# 9:30 AM order lunch automatically
rake slack:order_lunch

Demo

See demo images at demo.html

Contributing

See CONTRIBUTING.md.

Thank you, contributors!

LICENSE

MIT License. Copyright 2015-2016 MortgageClub.