https://github.com/colevoss/temperature-blanket
https://github.com/colevoss/temperature-blanket
Last synced: about 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/colevoss/temperature-blanket
- Owner: colevoss
- Created: 2023-01-11T22:47:49.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-01-12T19:49:35.000Z (over 3 years ago)
- Last Synced: 2025-02-14T04:17:48.974Z (over 1 year ago)
- Language: Go
- Size: 13.7 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Temperature Blanket
Small Go lambda that sends the previous day's High, Low, and Average temperature
to configured phone numbers via text for the use of crocheting a temperature blanket.
Currently only works for the Lincoln, NE.
It will send the text message every morning at 10 AM (CST)
## Integrations
### [Synoptic Weather API](https://synopticdata.com/)
The [Synoptic Mesonet Timeseries API](https://developers.synopticdata.com/mesonet/) is
used for gathering the historical air temperature for the previous day.
### Twilio
Text messages are sent using Twilio's SMS service
## Build
```bash
GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -o main main.go
```
## Zip
```bash
zip main.zip main
```
## Test
Phone numbers should be in the `1112223333` format where 1's are the area code, 2's are the
prefix and 3's are the final four. No need to include `+1`
```bash
TB_PHONE_NUMBERS="" go test ./blanket -v
```
## Lambda
Currently this lambda is manually deployed using the AWS Lambda console
## Env Variables
The following environment variables are necessary for the lambda to function properly
* `SYNOPTIC_API_TOKEN` - Private API token for access to the Synoptic weather API
* `TWILIO_ACCOUNT_SID` - Twilio account ID
* `TWILIO_API_TOKEN` - Private Twilio API Token
* `TWILIO_MESSAGE_SERVICE_ID` - Twilio Temperature Blanket Message Service ID
* `TB_PHONE_NUMBERS` - Comma delimited list of phone numbers to send the text to