This script fetches the lunch menu from deg16.no and publish it to a channel in Teams.
This script has now moved to AWS Lambda.
git clone https://github.com/rejlersembriq/deg16-lunchmenu-teams.git
cd deg16-lunchmenu-teams
# Permissions are needed for AWS to be able to read and execute our modules
chmod -R 777 node_modules
chmod 777 index.js
zip -r function.zip .
- Create a new AWS Lambda function
- Set runtime to be > nodejs8
- In the "Code entry type", choose "Upload a .zip file"
- Upload
function.zip
you created earlier - Hit "Save"
- Make sure Handler is
index.handler
- Under "Environmental Variables" enter "TEAMS_URL" for name and then the URL to your Incomming Webhook
- Go to CloudWatch/Rules and "Create rule"
- Event Source must be "Scehduled"
- Choose "Cron expression" with this expression
0 10 ? * MON-FRI *
- Click "Add Target" and choose "Lambda function"
- Select your AWS Lambda function
- Click "Configure Details"
For updating an already existing function you just have to zip your files again and upload using "Upload a .zip file".