Tweeting health code violations of Boston restaurants.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
secrets
.gitignore
bosfoodfails.paw
deploy.sh
dynamo.py
fs.py
kms.py
main.py
readme.md
requirements.txt
twitter.py

readme.md

###bosfoodfails

Get recent "food establishment" inspection violations and tweet them to @bosfoodfails.

Uses AWS Lambda, AWS KMS, AWS DynamoDB and the Socrata API (data.cityofboston.gov's Open Data vendor).

####Deploy to Lambda:

./deploy.sh

Cron settings for event source: cron(*/20 0-2,12-23 ? * * *)

####KMS secret management: Encrypt:

aws --profile bjacobel kms encrypt --key-id <key> --plaintext "<secretValue>" --query CiphertextBlob --output text | base64 --decode > ./secrets/<secretKey>

Decrypt:

with open('./secrets/<secretKey>', 'rb') as f:
    print(kms.decrypt(
        CiphertextBlob=f.read()
    )['Plaintext'])