Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nfriend/snow-day-notifier
A small Lambda function that scrapes PEI's public schools website and sends alerts (through IFTTT) if school is delayed or closed.
https://github.com/nfriend/snow-day-notifier
aws cron gitlab ifttt lambda scraping serverless typescript
Last synced: 7 days ago
JSON representation
A small Lambda function that scrapes PEI's public schools website and sends alerts (through IFTTT) if school is delayed or closed.
- Host: GitHub
- URL: https://github.com/nfriend/snow-day-notifier
- Owner: nfriend
- License: mit
- Created: 2019-11-17T03:10:15.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2020-11-25T07:33:22.000Z (about 4 years ago)
- Last Synced: 2024-11-14T15:42:52.666Z (2 months ago)
- Topics: aws, cron, gitlab, ifttt, lambda, scraping, serverless, typescript
- Language: TypeScript
- Homepage: https://gitlab.com/nfriend/snow-day-notifier
- Size: 427 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Snow Day Notifier
A small [Lambda](https://aws.amazon.com/lambda/) function that scrapes [PEI's public schools website](https://edu.princeedwardisland.ca/psb/)
and sends alerts (through [IFTTT](https://ifttt.com/)) if school is delayed or closed.Deployment of the Lambda function is managed by [GitLab CI/CD](https://docs.gitlab.com/ee/ci/) and the [Serverless framework](https://serverless.com/).
(See this project's [`.gitlab-ci.yml`](./.gitlab-ci.yml) and [`serverless.yml`](./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:
![A notification from IFTTT](img/ifttt-notification-example.jpg)
Clicking the notification redirects the user to the [PEI public schools website](https://edu.princeedwardisland.ca/psb/) to view the full post.
## Developing
1. Clone this repo: `git clone [email protected]:nfriend/snow-day-notifier.git`
1. Install dependencies: `cd snow-day-notifier && npm install`
1. Run any of the scripts found in this project's `package.json`, for example: `npm run build:watch`## Deploying
1. `git push` on `master`
## Project setup
This project expect a few CI/CD variables to be in place:
1. `AWS_ACCESS_KEY_ID`: The access key ID of your AWS IAM user
1. `AWS_SECRET_ACCESS_KEY`: The secret access key of your AWS IAM user
1. `IFTTT_KEY_JSON_ARRAY`: A JSON-formatted array of all [IFTTT Webhook keys](https://help.ifttt.com/hc/en-us/articles/115010230347-Webhooks-service-FAQ) that should be notified if a delay is detected. For example:```json
["ifttt-key-1", "ifttt-key-2"]
```1. `AWS_DYNAMO_REGION`: The AWS region of your IAM user (e.g. `ca-central-1`) for usage when setting up a DynamoDB connection
### IAM User
When creating the IAM user for this project, grant the user the following permissions:
- `AWSLambdaFullAccess`
- `IAMFullAccess`
- `AmazonDynamoDBFullAccess`
- `AnazonAPIGatewayAdministrator`
- `AWSCloudFormationFullAccess`![A screenshot of IAM's management console showing the necessary permissions](img/iam-permissions.png)