❤️ 🐱
Tweets a special reply to mentions using the correct #hashtag.
Uses Serverless framework and AWS Lambda.
Mention @thesecatstweet
in a tweet and don't forget the hashtag #valentinebot
.
This is a demonstration project for Serverless bots inspired by other useful bots and other cute bots.
- The
handleMentions
function does scheduled polling of mentions to perform replies (if you want a 💯 Serverless application) - The
reply
function performs just the favoriting and reply to a mention (can be called by the Twitter Streams API)
With node installed, install the Serverless Architecture:
$ npm i -g serverless
$ npm i -g serverless-azure-functions
$ npm i -g yarn
Clone this repository
$ git clone git@github.com:lynnaloo/valentines-day-bot.git
Install dependencies
$ cd azure
$ yarn install
Setup your Account Provider and Credentials
Add your images storage bucket and Twitter Credentials
- Create a file called
env.json
with these contents:
{
"TWIT_API_KEY": "xxxxxxx",
"TWIT_API_KEY_SECRET": "xxxxxxx",
"TWIT_ACCESS_TOKEN": "xxxxx",
"TWIT_ACCESS_TOKEN_SECRET": "xxxxxxx",
"TWIT_TIMEOUT_MS": 60000,
"TWIT_HASHTAG": "#happyvalentinebot",
"BUCKET": "bucket-o-gifs"
}
Run Unit Tests
npm test
Test Function locally
serverless invoke local -l -f handleMentions
Deploy Functions
$ sls deploy -v
MIT