/
basic_follow-unfollow_activity.py
93 lines (77 loc) 路 3.31 KB
/
basic_follow-unfollow_activity.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
"""
This template is written by @cormo1990
What does this quickstart script aim to do?
- Basic follow/unfollow activity.
NOTES:
- I don't want to automate comment and too much likes because I want to do
this only for post that I really like the content so at the moment I only
use the function follow/unfollow.
- I use two files "quickstart", one for follow and one for unfollow.
- I noticed that the most important thing is that the account from where I
get followers has similar contents to mine in order to be sure that my
content could be appreciated. After the following step, I start unfollowing
the user that don't followed me back.
- At the end I clean my account unfollowing all the users followed with
InstaPy.
"""
# imports
from instapy import InstaPy
from instapy import smart_run
# login credentials
insta_username = ''
insta_password = ''
# get an InstaPy session!
# set headless_browser=True to run InstaPy in the background
session = InstaPy(username=insta_username,
password=insta_password,
headless_browser=False)
with smart_run(session):
""" Activity flow """
# general settings
session.set_relationship_bounds(enabled=True,
delimit_by_numbers=True,
max_followers=4590,
min_followers=45,
min_following=77)
session.set_dont_include(["friend1", "friend2", "friend3"])
session.set_dont_like(["pizza", "#store"])
# activities
""" Massive Follow of users followers (I suggest to follow not less than
3500/4000 users for better results)...
"""
session.follow_user_followers(['user1', 'user2', 'user3'], amount=800,
randomize=False, interact=False)
""" First step of Unfollow action - Unfollow not follower users...
"""
session.unfollow_users(amount=500, InstapyFollowed=(True, "nonfollowers"),
style="FIFO",
unfollow_after=12 * 60 * 60, sleep_delay=601)
""" Second step of Massive Follow...
"""
session.follow_user_followers(['user1', 'user2', 'user3'], amount=800,
randomize=False, interact=False)
""" Second step of Unfollow action - Unfollow not follower users...
"""
session.unfollow_users(amount=500, InstapyFollowed=(True, "nonfollowers"),
style="FIFO",
unfollow_after=12 * 60 * 60, sleep_delay=601)
""" Clean all followed user - Unfollow all users followed by InstaPy...
"""
session.unfollow_users(amount=500, InstapyFollowed=(True, "all"),
style="FIFO", unfollow_after=24 * 60 * 60,
sleep_delay=601)
""" Joining Engagement Pods...
"""
photo_comments = ['Nice shot! @{}',
'Awesome! @{}',
'Cool :thumbsup:',
'Just incredible :open_mouth:',
'What camera did you use @{}?',
'Love your posts @{}',
'Looks awesome @{}',
'Nice @{}',
':raised_hands: Yes!',
'I can feel your passion @{} :muscle:']
session.set_do_comment(enabled = True, percentage = 95)
session.set_comments(photo_comments, media = 'Photo')
session.join_pods(topic='food', engagement_mode='no_comments')