:robot: Automate your Instagram activity with InstaBot, a customisable bot that likes, follows and comments

nickpettican, updated 🕥 2022-12-08 02:27:13

This code is no longer maintained. Bots are no longer safe, you could easily get banned.

Big thanks to everyone who got involved in this project, namely @erleiuat.

Instabot logo

InstaBot 1.3.0

Codacy Badge

Automate your Instagram activity with InstaBot - a customisable bot that likes, follows and comments

InstaBot is a Python-based automated Instagram bot made for Social Media Marketing Campaigns in order to reach the desired audience while saving time and money.

All you need is your username and password and other parameters - no API signup is needed.

Requirements

Python 2.7 and a server (a Raspberry Pi works great). See installation bellow to install libraries.

In a nutshell

InstaBot will

  • [x] Like posts of users you want to reach
  • [x] Comment on these posts
  • [x] Follow users you want to reach
  • [x] Unfollow users who don't follow you back within x hours
  • [x] Like posts in your news feed - only those you want to
  • [x] Build a profile object with all your followers and users you follow

Instabot runs in two modes

  • From XX:XX to YY:YY
  • All day (24/7)

The bot works on 24-hour military time, so you should input 09:00 to have it start at 9am.

How to install

  1. Download and install Python on your computer (a Raspberry Pi will have it pre-installed)
  2. Install dependencies running pip install -r requirements.txt.
  3. Install lxml
  4. Git clone this repo or download as a ZIP and extract
  5. Add your input (see bellow)
  6. Run python run.py

Your input

Open the config file and insert your credentials and preferences:

{
    "username": "username",
    "password": "password",
    "timezone": 0,
    "tags": "input/tags.csv",
    "tags_to_avoid": "input/tags_to_avoid.csv",
    "friends": "input/friends.csv",
    "like_news_feed": true,
    "likes_in_day": 500,
    "media_max_likes": 50,
    "media_min_likes": 0,
    "follow_in_day": 50,
    "unfollow": true,
    "follow_time_hours": 6,
    "comments_in_day": 0,
    "comments_list": [["Cool", "Sweet", "Awesome", "Great"],
                  ["😄", "🙌", "👍", "👌", "😊"], 
                  [".", "!", "!!", "!!!"]],
    "bot_start_at": "07:00",
    "bot_stop_at": "23:00"
}

| Variables | Defaults | Explanation | | :---------------: | :-----------------------------------------------------------------------------------: | :----------------------------------------------------------------------------------------------------------- | | username | username | Your Instagram username | | password | password | Your Instagram password | | timezone | 0 | Your timezone code, in order to run it at your local time | | tags | input/tags.csv | Tags file - alternatively you can use ['tag1', 'tag2', 'tag3',...] | | tags_to_avoid | input/tags_to_avoid.csv | Tags to avoid file - you can also use ['tagx', 'tagy',...] | | friends | input/friends.csv | Friends file, containing usernames all in one column - alternatively you can use ['friend1', 'friend2',...] | | like_news_feed | true | true or false whether you want to like your friends' posts | | likes_in_day | 500 | Number of likes InstaBot will do in a day | | media_max_likes | 50 | Maximum number of likes a post will have for InstaBot to like it | | media_min_likes | 0 | Minimum number of likes a post will have for InstaBot to like it | | follow_in_day | 50 | Number of users it will follow per day | | unfollow | true | true or false whether you want to unfollow users | | follow_time_hours | 6 | Time (in hours) it will follow these users for | | comments_in_day | 0 | Number of comments it will leave per day | | comments_list | [["Cool", "Awesome", "Great"], ["😄", "🙌", "👍", "😊"], [".", "!", "!!", "!!!"]] | What words you want shuffled to post comments | | bot_start_at | 07:00 | Time when InstaBot will start | | bot_stop_at | 23:00 | Time when InstaBot will stop |

Set likes

Tell Instabot how many posts you want to like per day. The maximum you will get to do before you get banned is 1000, but the default is set at 500 to keep it safe, especially if you're doing a daytime run (7am to 11pm). Instabot will take random time breaks between likes, to make it look more like a real person and not an automated bot.

"likes_in_day": 500

Set Instabot to like your friends posts so you don't have to. Only the friends usernames you included in the friends list will have their posts liked.

"friends": "input/friends.csv"
"like_news_feed": true

You can tell Instabot not to like posts with less than a minimum like number or more than a maximum like number. This property is useful because you will get more feedback from posts with a lower number of likes.

"media_max_likes": 50
"media_min_likes": 0

Give Instabot a list of hashtags to look for posts to like. I recommend you read this article for tips on using hashtags. You can either put the tags into input/tags.csv, as it is currently the case in the default values:

"tags": "input/tags.csv"

Or you can insert the tags straight into the config file like this:

"tags": ['tag1', 'tag2']

You can do the same with your friends list: either leave it as the default and include your friends' usernames in the friends.csv file or insert the usernames straight into the config file.

"friends": "input/friends.csv"

And finally, negative keywords are very important. These will help you avoid liking posts you don't want to like. These can be inserted the same way as the tags. The default is for them to be in a file.

"tags_to_avoid": "input/tags_to_avoid.csv"

Set comments

Instabot will comment randomly on posts that it liked. The comments are generated through a list of lists that gets shuffled to make a comment. You can add extra lists to increase the comment, or just reduce it to a single list of list e.g. [['I just want this comment']].

"comments_in_day": 0
"comments_list": [["Cool", "Sweet", "Awesome", "Great"],
                  ["😄", "🙌", "👍", "👌", "😊"], 
                  [".", "!", "!!", "!!!"]]

Follow and unfollow

Follow users of posts you liked:

"follow_in_day": 50

Set the amount of time you want to follow users:

"follow_time_hours": 6

Set Instabot to unfollow them if they haven't followed you back:

"unfollow": true

Set Instabot to run during the day

To make Instabot's activities look more real, you can set the bot to run between set times such as the default 7am to 11pm. Between those times the bot will either sleep or carry on unfollowing users it followed during the day.

"bot_start_at": "07:00"
"bot_stop_at": "23:00"

Make sure you use military time.

Instabot is smart

  • Before unfollowing a user, Instabot will check if that user followed you back. If that person followed you back, Instabot won't unfollow them. I mean it's only fair. It will also check if users are potentially fake accounts and will unfollow them. If a user was unfollowed recently but followed you back, he/she will be followed back again.
  • Internet connection breaks? No problem. InstaBot will wait until your internet connection is back in order to continue.
  • Need to shut it down quickly but you're still following lots of people? No problem. Instabot will save a list of the users it followed and will unfollow them next time it's turned on.

Motivation

Digital Marketing is becoming more and more complicated, with new platforms coming out and newer and better competitors appearing left right and center. InstaBot was created in order to save the time of having to reach out to the potential audience by liking posts and following those that will be interested in your service. Not everyone on Instagram is actively seeking out interesting profiles on the 'explore' tab, so in order to reach them, a like and a follow might be enough to spark that extra interest for them to visit your profile.

Server

If you haven't got a server I find a Raspberry Pi works just fine. All you need to do is follow the installation guide above and run the bot.

Future of InstaBot

Instabot is written in Python2, meaning it would need to be translated to Python3. Feel free to fork it and do this yourself.

The stats functionality is something I would also like to work on, but feel free to collaborate to make it happen sooner.

Warnings

  • Instagram does not like spam or bulk liking and following, so:

Keep the likes per day bellow 1000 in a 24 hour period, meaning if you use the bot for 12 hours a day, I would suggest only setting the likes to 500 or you might risk a ban.

  • Don't bulk unfollow:

You only get 15 unfollows in a short time period, so if you do a bulk unfollowing on your own, you risk InstaBot not being able to unfollow for a couple of hours.

  • Choose your tags wisely, and monitor the posts you are liking:

In case InstaBot likes unappropriate posts.

  • Don't rely on InstaBot as your only Social Media Digital Marketeer, Social Media is a two-way conversation, it's a way to gain an audience and talk to them, not a means to sell.

Issues

Bump certifi from 2018.4.16 to 2022.12.7

opened on 2022-12-08 02:27:13 by dependabot[bot]

Bumps certifi from 2018.4.16 to 2022.12.7.

Commits


Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) - `@dependabot use these labels` will set the current labels as the default for future PRs for this repo and language - `@dependabot use these reviewers` will set the current reviewers as the default for future PRs for this repo and language - `@dependabot use these assignees` will set the current assignees as the default for future PRs for this repo and language - `@dependabot use this milestone` will set the current milestone as the default for future PRs for this repo and language You can disable automated security fix PRs for this repo from the [Security Alerts page](https://github.com/nickpettican/InstaBot/network/alerts).

Bump nbconvert from 5.3.1 to 6.5.1

opened on 2022-08-23 17:27:43 by dependabot[bot]

Bumps nbconvert from 5.3.1 to 6.5.1.

Release notes

Sourced from nbconvert's releases.

Release 6.5.1

No release notes provided.

6.5.0

What's Changed

New Contributors

Full Changelog: https://github.com/jupyter/nbconvert/compare/6.4.5...6.5

6.4.3

What's Changed

New Contributors

Full Changelog: https://github.com/jupyter/nbconvert/compare/6.4.2...6.4.3

6.4.0

What's Changed

New Contributors

... (truncated)

Commits


Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) - `@dependabot use these labels` will set the current labels as the default for future PRs for this repo and language - `@dependabot use these reviewers` will set the current reviewers as the default for future PRs for this repo and language - `@dependabot use these assignees` will set the current assignees as the default for future PRs for this repo and language - `@dependabot use this milestone` will set the current milestone as the default for future PRs for this repo and language You can disable automated security fix PRs for this repo from the [Security Alerts page](https://github.com/nickpettican/InstaBot/network/alerts).

Bump mistune from 0.8.3 to 2.0.3

opened on 2022-07-29 22:45:53 by dependabot[bot]

Bumps mistune from 0.8.3 to 2.0.3.

Release notes

Sourced from mistune's releases.

Version 2.0.2

Fix escape_url via lepture/mistune#295

Version 2.0.1

Fix XSS for image link syntax.

Version 2.0.0

First release of Mistune v2.

Version 2.0.0 RC1

In this release, we have a Security Fix for harmful links.

Version 2.0.0 Alpha 1

This is the first release of v2. An alpha version for users to have a preview of the new mistune.

Version 0.8.4

  • Support an escaped pipe char in a table cell. #150
  • Fix ordered and unordered list. #152
  • Fix spaces between = in HTML tags
  • Add max_recursive_depth for list and blockquote.
  • Fix fences code block.
Changelog

Sourced from mistune's changelog.

Changelog

Here is the full history of mistune v2.

Version 2.0.4


Released on Jul 15, 2022
  • Fix url plugin in <a> tag
  • Fix * formatting

Version 2.0.3

Released on Jun 27, 2022

  • Fix table plugin
  • Security fix for CVE-2022-34749

Version 2.0.2


Released on Jan 14, 2022

Fix escape_url

Version 2.0.1

Released on Dec 30, 2021

XSS fix for image link syntax.

Version 2.0.0


Released on Dec 5, 2021

This is the first non-alpha release of mistune v2.

Version 2.0.0rc1

Released on Feb 16, 2021

Version 2.0.0a6


</tr></table> 

... (truncated)

Commits
  • 3f422f1 Version bump 2.0.3
  • a6d4321 Fix asteris emphasis regex CVE-2022-34749
  • 5638e46 Merge pull request #307 from jieter/patch-1
  • 0eba471 Fix typo in guide.rst
  • 61e9337 Fix table plugin
  • 76dec68 Add documentation for renderer heading when TOC enabled
  • 799cd11 Version bump 2.0.2
  • babb0cf Merge pull request #295 from dairiki/bug.escape_url
  • fc2cd53 Make mistune.util.escape_url less aggressive
  • 3e8d352 Version bump 2.0.1
  • Additional commits viewable in compare view


Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) - `@dependabot use these labels` will set the current labels as the default for future PRs for this repo and language - `@dependabot use these reviewers` will set the current reviewers as the default for future PRs for this repo and language - `@dependabot use these assignees` will set the current assignees as the default for future PRs for this repo and language - `@dependabot use this milestone` will set the current milestone as the default for future PRs for this repo and language You can disable automated security fix PRs for this repo from the [Security Alerts page](https://github.com/nickpettican/InstaBot/network/alerts).

Bump lxml from 4.2.4 to 4.9.1

opened on 2022-07-06 19:55:03 by dependabot[bot]

Bumps lxml from 4.2.4 to 4.9.1.

Changelog

Sourced from lxml's changelog.

4.9.1 (2022-07-01)

Bugs fixed

  • A crash was resolved when using iterwalk() (or canonicalize()) after parsing certain incorrect input. Note that iterwalk() can crash on valid input parsed with the same parser after failing to parse the incorrect input.

4.9.0 (2022-06-01)

Bugs fixed

  • GH#341: The mixin inheritance order in lxml.html was corrected. Patch by xmo-odoo.

Other changes

  • Built with Cython 0.29.30 to adapt to changes in Python 3.11 and 3.12.

  • Wheels include zlib 1.2.12, libxml2 2.9.14 and libxslt 1.1.35 (libxml2 2.9.12+ and libxslt 1.1.34 on Windows).

  • GH#343: Windows-AArch64 build support in Visual Studio. Patch by Steve Dower.

4.8.0 (2022-02-17)

Features added

  • GH#337: Path-like objects are now supported throughout the API instead of just strings. Patch by Henning Janssen.

  • The ElementMaker now supports QName values as tags, which always override the default namespace of the factory.

Bugs fixed

  • GH#338: In lxml.objectify, the XSI float annotation "nan" and "inf" were spelled in lower case, whereas XML Schema datatypes define them as "NaN" and "INF" respectively.

... (truncated)

Commits
  • d01872c Prevent parse failure in new test from leaking into later test runs.
  • d65e632 Prepare release of lxml 4.9.1.
  • 86368e9 Fix a crash when incorrect parser input occurs together with usages of iterwa...
  • 50c2764 Delete unused Travis CI config and reference in docs (GH-345)
  • 8f0bf2d Try to speed up the musllinux AArch64 build by splitting the different CPytho...
  • b9f7074 Remove debug print from test.
  • b224e0f Try to install 'xz' in wheel builds, if available, since it's now needed to e...
  • 897ebfa Update macOS deployment target version from 10.14 to 10.15 since 10.14 starts...
  • 853c9e9 Prepare release of 4.9.0.
  • d3f77e6 Add a test for https://bugs.launchpad.net/lxml/+bug/1965070 leaving out the a...
  • Additional commits viewable in compare view


Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) - `@dependabot use these labels` will set the current labels as the default for future PRs for this repo and language - `@dependabot use these reviewers` will set the current reviewers as the default for future PRs for this repo and language - `@dependabot use these assignees` will set the current assignees as the default for future PRs for this repo and language - `@dependabot use this milestone` will set the current milestone as the default for future PRs for this repo and language You can disable automated security fix PRs for this repo from the [Security Alerts page](https://github.com/nickpettican/InstaBot/network/alerts).

Bump numpy from 1.15.0 to 1.22.0

opened on 2022-06-21 21:32:53 by dependabot[bot]

Bumps numpy from 1.15.0 to 1.22.0.

Release notes

Sourced from numpy's releases.

v1.22.0

NumPy 1.22.0 Release Notes

NumPy 1.22.0 is a big release featuring the work of 153 contributors spread over 609 pull requests. There have been many improvements, highlights are:

  • Annotations of the main namespace are essentially complete. Upstream is a moving target, so there will likely be further improvements, but the major work is done. This is probably the most user visible enhancement in this release.
  • A preliminary version of the proposed Array-API is provided. This is a step in creating a standard collection of functions that can be used across application such as CuPy and JAX.
  • NumPy now has a DLPack backend. DLPack provides a common interchange format for array (tensor) data.
  • New methods for quantile, percentile, and related functions. The new methods provide a complete set of the methods commonly found in the literature.
  • A new configurable allocator for use by downstream projects.

These are in addition to the ongoing work to provide SIMD support for commonly used functions, improvements to F2PY, and better documentation.

The Python versions supported in this release are 3.8-3.10, Python 3.7 has been dropped. Note that 32 bit wheels are only provided for Python 3.8 and 3.9 on Windows, all other wheels are 64 bits on account of Ubuntu, Fedora, and other Linux distributions dropping 32 bit support. All 64 bit wheels are also linked with 64 bit integer OpenBLAS, which should fix the occasional problems encountered by folks using truly huge arrays.

Expired deprecations

Deprecated numeric style dtype strings have been removed

Using the strings "Bytes0", "Datetime64", "Str0", "Uint32", and "Uint64" as a dtype will now raise a TypeError.

(gh-19539)

Expired deprecations for loads, ndfromtxt, and mafromtxt in npyio

numpy.loads was deprecated in v1.15, with the recommendation that users use pickle.loads instead. ndfromtxt and mafromtxt were both deprecated in v1.17 - users should use numpy.genfromtxt instead with the appropriate value for the usemask parameter.

(gh-19615)

... (truncated)

Commits


Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) - `@dependabot use these labels` will set the current labels as the default for future PRs for this repo and language - `@dependabot use these reviewers` will set the current reviewers as the default for future PRs for this repo and language - `@dependabot use these assignees` will set the current assignees as the default for future PRs for this repo and language - `@dependabot use this milestone` will set the current milestone as the default for future PRs for this repo and language You can disable automated security fix PRs for this repo from the [Security Alerts page](https://github.com/nickpettican/InstaBot/network/alerts).

Bump notebook from 5.6.0 to 6.4.12

opened on 2022-06-16 23:16:19 by dependabot[bot]

Bumps notebook from 5.6.0 to 6.4.12.

Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) - `@dependabot use these labels` will set the current labels as the default for future PRs for this repo and language - `@dependabot use these reviewers` will set the current reviewers as the default for future PRs for this repo and language - `@dependabot use these assignees` will set the current assignees as the default for future PRs for this repo and language - `@dependabot use this milestone` will set the current milestone as the default for future PRs for this repo and language You can disable automated security fix PRs for this repo from the [Security Alerts page](https://github.com/nickpettican/InstaBot/network/alerts).
Nicolas Pettican

I read, drink tea and write code

GitHub Repository