This is a Slack bot that parses the Sparkbox lunch Google Sheet and reminds us who is on duty for the upcoming Friday lunch.
To run the app there are several ENV
variables that you need to set:
URL to the Google Sheet you'll be using with your team. Here's a sample Sheet you can copy to start your own.
ID of the Google Sheet you want to parse. In our sample Sheet, the ID is 1fZXtKnxwcxP4GWGMRFtGun1VOnDYuiAgAR_yWlgEx_o
.
The Slack bot token you received when installing and configuring the lunch-bot
in Slack Bots
Optional: The ID of the Slack group to alert.
This is an email and public key you generate for lunch-bot
to use in reading via the Google Sheets API. To generate your serviceEmail
:
- Create a project in Google Developer Console, for example: "Sheets App".
- Enable Drive API for project under APIs & auth > APIs.
- Create service auth credentials for project under APIs & auth > Credentials > Create new Client ID: Service account.
- Collect the listed service email address.
- Regenerate and download the P12 key.
- Convert the .p12 file into .pem format:.
openssl pkcs12 -in *.p12 -nodes -nocerts > sheets.pem
NOTE: when prompted for password, it's notasecret
Finally, share the Sheets document to service email address using the Share button on your sheet.
Thanks to the google-sheets-api npm module for providing the instructions for serviceEmail
and sheetPem
.