open-index/open-npm huggingface dataset:
npm package: @lunchly/service-zerocater
Description: ZeroCater API consumer for Lunchly.
Author: Chris Vogt
Latest version: 0.2.1

# service-zerocater [![CircleCI](https://circleci.com/gh/lunchly/service-zerocater/tree/master.svg?style=svg)](https://circleci.com/gh/lunchly/service-zerocater/tree/master) [![codecov](https://codecov.io/gh/lunchly/service-zerocater/branch/master/graph/badge.svg)](https://codecov.io/gh/lunchly/service-zerocater)

> ZeroCater integration for Lunchly

Wraps the ZeroCater REST API, allowing the Lunchly meal-announcement bot to query current and upcoming meals.


## Install

```
$ npm install @lunchly/service-zerocater --save
```


## Usage

###### Lunchly integration

```js
const { today } = require('@lunchly/service-zerocrater');
const companyId = controller.config.zerocrater_company_id;
const {
  id,
  name,
  vendor_name: vendorName,
  vendor_image_url: vendorImageURL,
  vendor_description: vendorDescription
} = await today(companyId);

const mealsURL = ZEROCRATER_MEALS_URL.replace('{companyId}', companyId);
const mealURL = `${mealsURL}/${id}`;

const messageTemplate = `Today's lunch is *${name}*, brought to you by *${vendorName}* — _${vendorDescription}_`;
```


## API

### .all

Type: `Array`

All meals returned by ZeroCater.

### .today()

Type: `Function`

Today's meal.


## License

MIT © [Chris Vogt](https://www.chrisvogt.me)
npm package: @lunchly/slack-bot
Description: A Slack bot that announces meals for your company.
Author: Chris Vogt
Latest version: 0.2.0

# Lunchly [![CircleCI](https://circleci.com/gh/lunchly/slack-bot/tree/master.svg?style=svg)](https://circleci.com/gh/lunchly/slack-bot/tree/master) [![codecov](https://codecov.io/gh/lunchly/slack-bot/branch/master/graph/badge.svg)](https://codecov.io/gh/lunchly/slack-bot)

> Slack bot that announces daily catered meals

Lunchly is a Slack bot that posts consistent, useful daily meal announcements for companies with scheduled food catering. It only supports ZeroCater because that is the catering service used at my office, but feel welcome to submit a pull request adding support for other catering services.


### Requirements

Lunchly runs on Node 8+ and uses Slack's [Real Time Messaging API](https://api.slack.com/rtm) and [Web API](https://api.slack.com/web). ZeroCater integration is provided via the [@lunchly/service-zerocater](https://github.com/lunchly/service-zerocater) plugin, which exposes a `today()` method to fetch today's meal.


### Install

To get started, clone this repository and install dependencies using `npm`.

```sh
# Get the code
git clone https://github.com/lunchly/slack-bot.git

# Install dependencies
npm install
```


### Configure

Once you have complete the above steps your instance of Lunchly is ready to be configured. A list of channels to monitor and their associated ZeroCater account IDs is required. Your ZeroCater account ID can be found in the URL of your account's meal page.

1. Copy `sites.example.json` to `sites.json` and replace with your values.

2. If you don't already have one, [create a new bot user](https://api.slack.com/bot-users#creating-bot-user) for your Slack team. You'll need the [bot token](https://api.slack.com/docs/token-types#bot) (begins with `xoxb-`) to run Lunchly.


### Run

To run Lunchly, ensure the configuration steps above are completed, and do the following:


###### Development

```SLACK_BOT_API_TOKEN=xoxb-0000-your-token npm run dev```


###### Production

```SLACK_BOT_API_TOKEN=xoxb-0000-your-token npm run start```


### Use

Lunchly listens for `!lunch` in all channels it is a member of. If a meal is found for that day then the bot will post a message containing details about the meal.

![Lunchly screenshot, ZeroCater integration](screenshot.png)

## License

MIT © [Chris Vogt](https://www.chrisvogt.me)