This bot retrieves active police incidents from dallasopendata and posts all active incidents to a Mastodon instance.
Alerts available at @[email protected].
This bot runs on AWS Lambda every 2 minutes.
Redis instance hosted by Redis Enterprise.
Making a request to Mastodon for a duplicate incident is deduplicated first to by using a Redis cache, and then duplicate requests to Mastodon are deduplicated via Mastodon's Idempotency-Key header.
To get OpenData secrets, see Socrata: Generating an App Token.
To get Mastodon secrets, log in to your Mastodon account and go to Settings -> Development.
Run Redis locally at localhost:6379
, or provide remote Redis location via the REDIS_(URL|USERNAME|PASSWORD)
environment variables.
nvm use
npm install
npm run build
DALLAS_ALERTS_OPENDATA_TOKEN=${your_opendata_token} \
DALLAS_ALERTS_MASTODON_TOKEN=${your_mastodon_token} \
npm run start
Not the most automated way:
rm -rf function
npm run build
cp -R dist function
cp package.json function/package.json
cd function
npm install --omit=dev
zip -r function.zip .