A small Lambda function that scrapes PEI's public schools website and sends alerts (through IFTTT) if school is delayed or closed.
Deployment of the Lambda function is managed by GitLab CI/CD and the Serverless framework.
(See this project's .gitlab-ci.yml
and serverless.yml
.)
This function is scheduled to run every 5 minutes.
When the Lambda function identifies a potential closure, it sends a mobile notification that looks like this:
Clicking the notification redirects the user to the PEI public schools website to view the full post.
- Clone this repo:
git clone git@gitlab.com:nfriend/snow-day-notifier.git
- Install dependencies:
cd snow-day-notifier && npm install
- Run any of the scripts found in this project's
package.json
, for example:npm run build:watch
git push
onmaster
This project expect a few CI/CD variables to be in place:
-
AWS_ACCESS_KEY_ID
: The access key ID of your AWS IAM user -
AWS_SECRET_ACCESS_KEY
: The secret access key of your AWS IAM user -
IFTTT_KEY_JSON_ARRAY
: A JSON-formatted array of all IFTTT Webhook keys that should be notified if a delay is detected. For example:["ifttt-key-1", "ifttt-key-2"]
-
AWS_DYNAMO_REGION
: The AWS region of your IAM user (e.g.ca-central-1
) for usage when setting up a DynamoDB connection
When creating the IAM user for this project, grant the user the following permissions:
AWSLambdaFullAccess
IAMFullAccess
AmazonDynamoDBFullAccess
AnazonAPIGatewayAdministrator
AWSCloudFormationFullAccess