Skip to content

Serverless Valentine's Day Twitter Bot that sends random images as replies to a hashtag

License

Notifications You must be signed in to change notification settings

lynnaloo/valentines-day-bot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Valentine's Day Bot

❤️ 🐱

Tweets a special reply to mentions using the correct #hashtag.

Uses Serverless framework and AWS Lambda.

Made with Serverless Norfolk JS Inspired

Try it out

Mention @thesecatstweet in a tweet and don't forget the hashtag #valentinebot.

About

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)

Install

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 and Testing

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

Deployment

Deploy Functions

$ sls deploy -v

See Also

License

MIT

About

Serverless Valentine's Day Twitter Bot that sends random images as replies to a hashtag

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published