-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathuser_log_folder_example.py
More file actions
executable file
路52 lines (37 loc) 路 1.9 KB
/
Copy pathuser_log_folder_example.py
File metadata and controls
executable file
路52 lines (37 loc) 路 1.9 KB
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
"""Example Case of the Script"""
from instapy import InstaPy
try:
# if you don't provide arguments, the script will look for INSTA_USER and INSTA_PW in the environment
session = InstaPy(username='test', password='test',multi_logs=True)
"""Logging in"""
# logs you in with the specified username and password
session.login()
"""Comment util"""
session.set_do_comment(enabled=True, percentage=25)
session.set_comments(['Awesome', 'Really Cool', 'I like your stuff'])
"""Follow util"""
# default enabled=False, follows ~ every 10th user from the images
session.set_do_follow(enabled=True, percentage=10)
session.set_use_clarifai(enabled=False)
"""Like util"""
# searches the description and owner comments for the given words
# and won't like the image if one of the words are in there
session.set_dont_like(['food', 'eat', 'meal'])
# will ignore the don't like if the description contains
# one of the given words
session.set_ignore_if_contains(['glutenfree', 'french', 'tasty'])
"""Different tasks"""
# you can put in as much tags as you want, likes 100 of each tag
session.like_by_tags(['#test'], amount=100)
# you can also set to like a specific media (Photo / Video)
session.like_by_tags(['#test'], amount=10, media='Photo')
""""Like by feed"""
# likes a given amount of posts on your feed, taking into account settings of commenting, like restrictions etc
session.like_by_feed(amount=100)
session.unfollow_users(
amount=10) # unfollows 10 of the accounts your following -> instagram will only unfollow 10 before you'll be 'blocked
# for 10 minutes' (if you enter a higher number than 10 it will unfollow 10, then wait 10 minutes and will continue then)
finally:
"""Ending the script"""
# clears all the cookies, deleting you password and all information from this session
session.end()