Automatic Instagram-Bot with Node.js project in TypeScript 3.0.
What's included:
- TypeScript 3.0,
- TSLint 5 with Microsoft rules,
- Prettier to enforces a consistent code style (but it's optional),
- NPM scripts for common operations,
- .editorconfig for consistent file format.
Just watch the Youtube video
These configuration setting should be set inside the src bot-config.json file when you are compiling the project with npm run watch
. When you are only editing the configuration without compiling it, just edit the bot-config.json in the build/src
directory.
- hashtags
hashtags, list of hashtags the bot should search for, without '#' prefix
- sleepStart
sleepStart, time to send the bot to sleep only in this format 'hh:mm' or 'h:mm'
- sleepEnd
sleepEnd, time to wake the bot up again only in this format 'hh:mm' or 'h:mm'
- botModes
botModes, list of names of modes to start, format: 'routine1, routine2, routine3, ...' available botModes, see strategies
- maxLikesPerHashtag
maxLikesPerHashtag, maximum likes the bot is allowed to make per hashtag per 24 hours when the limit is reached, the bot takes another hashtag
- maxLikesPerDay
maxLikesPerDay, maximum likes the bot is allowed to make per 24 hours
- maxDislikesPerDay
maxDislikesPerDay, maximum dislikes per 24 hours
- minDislikeWaitTime
minDislikeWaitTime, minimum time to wait to dislike a mediapost the bot liked before (time in minutes)
- maxFollowsPerDay
maxFollowsPerDay, max people to follow in 24 hours
- maxUnfollowsPerDay
maxUnfollowsPerDay, max people to unfollow in 24 hours
- minUnfollowWaitTime
minUnfollowWaitTime, minimum time to wait to unfollow a user the bot followed before (time in minutes)
- maxFollowsPerHashtag
maxFollowsPerHashtag, maximum follows the bot is allowed to make per hashtag per 24 hours when the limit is reached, the bot takes another hashtag (only used by sinlge follow mode)
- followerOptions
- unwantedUsernames
unwantedUsernames, list of strings containing full or parts of usernames that are not wanted to be followed
- followFakeUsers
followFakeUsers, if bot should follow users that the bot thinks are fake users
- followSelebgramUsers
followSelebgramUsers, if bot should follow users that the bot thinks are selebgram users
- followPassiveUsers
followPassiveUsers, if bot should follow users that the bot thinks are passive (inactive) users
- unfollowOnlyWhenFollowingMe
unfollowOnlyWhenFollowingMe, only let bot unfollow user if user is following user
- unwantedUsernames
- postOptions
- maxLikesToLikeMedia
maxLikesToLikeMedia, maximum likes a post is allowed to have to be liked by the bot
- minLikesToLikeMedia
minLikesToLikeMedia, minimum likes a post is allowed to have to be liked by the bot
- maxLikesToLikeMedia
- waitTimeBeforeDelete
waitTimeBeforeDelete, minutes to wait before delete stored data (only unfollowed and disliked images) this option is only available to prevent an enormous data stored as json (time in minutes)
- isTesting
isTesting, used only to let bot be checkable by automated tests
Strategies or botModes (reference in bot-config.json) can be used to configure the behaviour of the bot while online. One maybe just wants to like pictures every day, the other only wants to follow users automatically. There are a few strategies to use to complete different kind of behaviours. All strategies can be used together.
- like-classic-mode
- follow-classic-mode
- unfollow-classic-mode
If you don't want to change anything in the code and just use the bot with and change the configuration, follow these steps:
Download and install all npm dependencies
git clone https://github.com/hobbydevs/InstabotJS
cd InstabotJS
npm install
or just download and unzip current master
branch:
wget https://github.com/hobbydevs/InstabotJS/archive/master.zip -O InstabotJS
unzip InstabotJS.zip && rm InstabotJS.zip
After that go to the bot-config.json and change the username to your instagram username and the password to your instagram password.
When you've done all just go to the build directory and run
node main.js
the bot can be customized by the bot-config.json file. To see all available options to customize the bot in the .json see the typescript config.
To change some code and compile the typescript code to javascript, just run npm run watch
. This will copy the bot-config.json from the src to the build/src directory and watch filechanges and compile them to javascript.
When you finished coding some stuff just go to build/src
and run node main.js
and watch your little bot go 🔥
-
Likes limit: no more than one like every 28 – 36 seconds (1000 likes at a time for a period of 24 hours);
-
Followers limit: no more than one like every 28 – 36 seconds and no more than 200 followers an hour (1000 followers at a time for a period of 24 hours);
-
Followers + Likes limit: no more than 2000 (1000 + 1000) every 24 hours with the interval of 28 – 38 seconds;
-
Unfollow limit: the interval of 12-22 seconds, no more than 1000 every 24 hours from unmutual and 1000 from mutual;
-
Mentions limit: 5 nicks in a message with the interval of 350-450 seconds;
-
Comments limit: no more than 12-14 an hour with the interval of 350 – 400 seconds, overlimit might be treated as spam;
-
Publishing images: you shouldn’t add too many images to a new Instagram account, the best practice is to publish no more than 2-3 images a day, and for older accounts this figure is 9-12 images.
You should keep these in mind in case you’re not sure that Instagram treats your account as a trusted one, or if you want to secure your account from getting blocked to the full.
- The actions interval for the first 12-20 days is 36-48 seconds;
- The total limit for all kinds of actions (follow, unfollow, like) is 500 every 24 hours.
The best strategy for new accounts would be to publish 2 or 3 images and let the account settle in for 2 or 3 weeks.
clean
- remove coverage data, Jest cache and transpiled files,build
- transpile TypeScript to ES6,watch
- interactive watch mode to automatically transpile source files,lint
- lint source files and tests,test
- run tests,test:watch
- interactive watch mode to automatically re-run tests
If you want to support this project send a PR or give it a star. Want to say thank you? Help me out