Sender example

The example of simple Sender class usage.

Preparations

Import instabot from sources


In [1]:
import sys
sys.path.append('../../')
from instabot import User, Sender

Login users to be used in instabot. I suggest you to add as many users as you have because all get requests will be parallized between them to distribute the Instagram servers load.


In [2]:
_ = User('instabotproject', 'password')
_ = User("user_for_scrapping1", "password")
_ = User("user_for_scrapping2", "password")
_ = User("user_for_scrapping3", "password")

Init the Sender class with the main user's username. This user will be used to put likes / follows and other activity stuff.


In [3]:
send = Sender("instabotproject")

Activity examples

You can like medias by geolocation like this


In [4]:
geo_name = "МФТИ"
send.like_geo_medias(geo_name, total=100, delay=5)


like medias: 23it [01:32,  5.66s/it]../../instabot/sender/sender.py:102: UserWarning: Error while liking stanislavkruglik's media.
  "Error while liking %s's media." % media['user']['username'])
like medias: 100it [07:31,  4.52s/it]
Out[4]:
False

To follow someone's followers code like this


In [5]:
follow_followers_of = "ohld"
send.follow_followers(follow_followers_of, total=10, delay=10)


follow users: 10it [01:57, 12.73s/it]
Out[5]:
False