Skip to content

Menu based bot script for doing common actions (follow, unfollow, like, bulk) in Twitter v2 API

License

Notifications You must be signed in to change notification settings

RedxLus/bot-twitter-follow-in-bash

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Bot twitter follow in bash

This bot is current in v0.5 so is in beta. May have some unexpected errors. As always, use at your own risk.

This bot is build using Twitter API V2 only. You can check the code, is very simple. Works with functions and curl api calls directly. It does not go through any external server or need other dependencies. It can be run on any computer or server running Linux or Mac.

Have working currently:

image

To do (next versions):

  • Detect commands need and install or ask to install
  • Save unfollows to not follow again (need change the logic of the functions)
  • Get the token without need postman (only first config, later it auto update the token)
  • Whitelist_users to ignore when follow or unfollow

Table of content of this readme

0. Access to developer dashboard in Twitter

Go to https://developer.twitter.com/en/portal/dashboard and login.

It will prompt to enter some things as:

  • What country are you based in?
  • What's your use case?

We accept the terms and conditions and we are already inside.

In some cases, especially when you already have a certain number of followers, you may get: You do not qualify for Essential access at this time. But they let you access Elevated access.

Remember read the https://help.twitter.com/en/rules-and-policies/twitter-automation and https://developer.twitter.com/en/docs/twitter-api/rate-limits#v2-limits

1. Configure the project

To create a Project, click on "New Project" in the Projects & Apps page inside the developer portal.

Set:

image image image

2. Configure postman

This has to be done only 1 time. Then the script is automatically refreshed. I recommend downloading the Postman app for convenience, but it can still be done in the browser.

Go to the public postman workspace: https://www.postman.com/twitter/workspace/twitter-s-public-workspace/request/9956214-419497de-aefc-4a8e-9ff5-1b4f73d948e3

Change type to: OAuth 2.0

In Configure New Token -> Configure options:

Search Input
Token Name login-example
Grant Type Authorization Code (With PKCE)
Auth URL https://twitter.com/i/oauth2/authorize
Access Token URL https://api.twitter.com/2/oauth2/token
Client ID Generate in Twitter dashboard
Client Secret Generate in Twitter dashboard
Scope tweet.read users.read follows.write offline.access follows.read like.write
State state

image

Now copy the Access Token to TK_POSTMAN_ACCESS and refresh_token to TK_POSTMAN_REFRESH in config.json

image

3. Configure the bot

To configure this bot. Change the parameters of the config.json file.

Search Input
your_username Your screen username. Without @
CLIENT_ID Check Twitter dashboard
API_KEY Check Twitter dashboard
API_SECRET_KEY Check Twitter dashboard
TK_POSTMAN_ACCESS Check Postman
TK_POSTMAN_REFRESH Check Postman

4. Use the bot

Just run:

bash twitter-bot.sh

Have English menu:

image

And Spanish menu:

image

You can change the language by changing the language variable in config.json. Currently just English and Spanish supported. But feel free to MR and update.

FAQ

Limit of API?

The script read the header and detect when the API have a limit and will auto refresh every minute until can continue.

image

Auto graph chart all actions

The script will generate a graph of all actions: Follow, Unfollow and Likes.

You can check in the dir gnuplot.

graph

About

Menu based bot script for doing common actions (follow, unfollow, like, bulk) in Twitter v2 API

Topics

Resources

License

Stars

Watchers

Forks

Languages