Skip to content

AWS Lambda function to scrap daily lunch menus and post them to a slack channel

License

Notifications You must be signed in to change notification settings

amuelli/serverless-slack-lunch-hunter

Repository files navigation

Slack Lunch Hunter

serverless license

This is a simple Serverless project with a single AWS Lambda function to scrap daily lunch menus and post them to a slack channel.

Demo of the Slack integration

Configuration

  1. Fork this repository

  2. cd into project directory and install node modules:

npm install
  1. Set up an incoming webhook in Slack, copy .env.example file to .env and insert your Slack incoming webhook url there. (You'll see that the webhook is separated into 2 env variabes, this is because of testing.)

  2. Customize which websites should be scraped for their daily menus in config/default.yml

  3. Post a menu summary to your slack channel by running:

node run.js

Deploy with Serverless

Although you can run the lunch hunter locally on your machine or on any server with node.js and a cron job, this project is meant to be run as a Lambda function on AWS and deployed through the serverless framework.

  1. Setup your AWS Credentials

  2. Install Serverless.js

npm install -g serverless
  1. Deploy with Serverless
serverless deploy

For testing purposes the main Lambda function can be triggered via API Gateway ( GET /notify ) as well as a schedule event (you can change the specific time in serverless.yml).

Memory size limit is set to the lowest value of 128MB.

Supported Websites

Feel free to fork this project and write your own parser or api client for your favourite cantine or restaurant website.

Credits

This project is based on code and ideas from

About

AWS Lambda function to scrap daily lunch menus and post them to a slack channel

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published