Dogpack is a Twitter bot which automates announcing and confirming meetups of DogpatchJS. It will:
- Tweet announcing DogpatchJS the morning of the meetup
- Tweet a reminder the day before the meetup
- Accept RSVPs in the form of DMs containing emoji
- Tweet a confirmation or cancellation of the event depending on how many RSVPs are received
Dogpack is hosted on AWS Lambda. To set up your own Dogpack:
-
Install dependencies:
NPM_CONFIG_CHROMIUM_CHANNEL=dev PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=1 npm i
-
Create a new account on AWS
- Create a new user with "AdministratorAccess" privileges.
- Save Amazon credentials
npx serverless config credentials --provider aws --key KEY --secret SECRET --profile dogpackProd
.
-
Create a new Twitter app key, setting callback URL to http://localhost:3000/callback.
-
Copy
messages.json.sample
tomessages.json
, and customize with your meetup details. -
Authenticate with Twitter:
- Run
node ./scripts/setupTwitter.js CONSUMER_KEY CONSUMER_SECRET > ../dogpack-keys.prod.json
and open http://localhost:3000 in a web browser. - Click the link and authorize your Twitter app.
- Run
-
Deploy:
npx serverless --stage prod deploy
- Note the HTTPs endpoint URL for your webhook in the output. It might be of the form:
https://xxx.execute-api.us-east-1.amazonaws.com/dev/hook-xxx
. Use this in the following step.
- Note the HTTPs endpoint URL for your webhook in the output. It might be of the form:
-
Set up Twitter's DM Webhook: run
./scripts/setupWebhook.js ../dogpack-keys.prod.json https://your-webhook-https-url
You should now have a functioning bot! Test it out by triggering the "postEvent" and "postRSVPs" functions via
npx serverless --stage prod invoke -f your-function-name -l