Skip to content
Go to file

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time

Lena Twitter Bot


This dead simple nodejs Twitter bot will retweet statuses based on your current search criteria, follow users based on same items, and favorite tweets too.

I'm using this to learn Node.js language and Git, and serverless stuff.

Actual Features:

  • Retweet
  • Favorite
  • Follow

Serverless: AWS Lambda installation (recommanded)

On a simple Linux, with AWSCLI installed.

Install requirement

  • AWSCLI: guide (useless on Amazon Linux EC2)
  • Nodejs: Follow this great guide (Applicable to AWS Amazon Linux (EC2))
  • Serverless Framework: npm install -g serverless

Create your serverless project

  • mkdir lena-bot && cd lena-bot
  • serverless create -t aws-nodejs
  • npm init
  • npm install twitter --save

Configure AWSCLI

  • aws configure with an access key granded to create s3, cloudwatch, and lambda stuff

Configure your serverless bot

  • download config.js, handler, and serverless.yml from Git and adapt to your needs (names, event timer, ...)
  • configure your access key (Twitter API) in config.js

deploy your serverless stack

  • serverless deploy --stage prod

Warning: some Lambda functions won't be scheduled (no lambda triggers). You will need to setup it manually.

Linux installation (your own server)

Node.js Installation:

Follow this great guide (Applicable to AWS Amazon Linux (EC2))

Lena Installation:

  • mkdir bot
  • cd bot
  • npm init (follow the wizard)
  • npm install twitter more info
  • create your own API Keys on
    • Consumer Key
    • Consumer Secret
    • Access Token Key
    • Access Token Secret
  • Clone the git repo : git clone

Lena Configuration:

  • Setup your Consumer and Access Token (Key and Secret) in config.js file
  • Configure your search criteria (params), and iteration in each .js file
var params = {
  q: '#Nodejs OR #Github',
  count: 10,
  result_type: 'recent',
  lang: 'fr'
  • Setup crontab to periodicaly run your Node.js files.

    • crontab -e
    • Example for each 12 hours scheduling:

    0 */12 * * * /usr/local/bin/node /path/to/your/bot/follow.js >> /path/to/your/logs/logs-follow.txt


  • Exception on your own ID (don't follow yourself)
  • Add users to public list (to be followed by another Twitter account)
  • Follow back followers
  • Automaticaly Reply to DM
  • Send DM to new followers
  • Bio description search
  • Timestamp Logs (@kallioli) - not needed if you are using Lambda
  • Follow Friday
  • Serverless compatibility
  • etc...


Beware of the current Twitter rate limit


No releases published


No packages published
You can’t perform that action at this time.