Skip to content
This repository has been archived by the owner on Jan 15, 2023. It is now read-only.

This is a real-time Twitter autobase bot that uses twitter-autohook.

Notifications You must be signed in to change notification settings

opemvbs/autohookbase_twitter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

autohookbase_twitter

This is a Twitter bot that utilizes twitterdev/autohook to automatically process Twitter's webhook for you asynchronously. This bot will detect a Direct Message event which will take the message that someone Direct Message'd your Twitter account as an input, and then check it whether or not it contains an image/link or just a message, and will process it to post as your own tweet. You are able to filter to only process messages that contains certain keyword, as an example inside is using /tst/ keyword as a filter. See how it works here.

Requirements

  • Operating System: Linux or Windows

I used Linux solely while developing this bot, so if there's a problem running this bot on Windows, you're on your own. But in theory there shouldn't be any problem anyway.

This bot uses Node.js in order to run the codes. Install the current version of Node.js.

  • Git

To clone the repository.

Make a new Twitter account for your autobase, don't use your personal Twitter account. Create the app for your bot to use here, register your app, and then put your authentication information to the .env file.

You can deploy the bot to Heroku or Glitch so you don't have to host it on your computer. Note: Heroku and Glitch have its own limitations, read more about it yourself.

Dependencies

This javascript program depends on three packages:

$ npm install twitter-autohook

$ npm install request

$ npm install dotenv

Or you can just do this on terminal inside the cloned repository.

$ npm install

Usage

$ node index.js

TODO

  • Put in more features, like put limitations on minimal followers, tweets, or other things other people had to have in order to use your autobase.
  • Put catch error function to catch more errors/anomalies.
  • Other improvements and features that is not in my mind right now.

Updates

  • Updated script to attach the URL of the posted tweet in direct message to users.
  • Updated script to be able to set followers and tweets requirements from user sending message to the bot.
  • Updated script with catch error functions.