Skip to content

Instantly share code, notes, and snippets.

@dublado
Last active June 21, 2022 11:02
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save dublado/4bc0222d623ade3ccc7930365a275488 to your computer and use it in GitHub Desktop.
Save dublado/4bc0222d623ade3ccc7930365a275488 to your computer and use it in GitHub Desktop.
Instapy example
from instapy import InstaPy
#if you don't provide arguments, the script will look for INSTA_USER and INSTA_PW in the environment
session = InstaPy(username='clubedelider', password='pass', headless_browser=True)
'''
session.set_relationship_bounds(enabled=True,
potency_ratio=1.34,
delimit_by_numbers=True,
max_followers=850000,
max_following=449000,
min_followers=1,
min_following=1)
'''
session.set_relationship_bounds(enabled=False)
#session.set_dont_like(['#exactmatch', '[startswith', ']endswith', 'broadmatch'])
session.set_dont_like(['tupperware'])
session.login()
#likes specified amount of posts for each hashtag in the array (the '#' is optional)
#in this case: 100 dog-posts and 100 cat-posts
session.set_user_interact(amount=5, randomize=True, percentage=50, media='Photo')
#session.set_do_follow(enabled=False, percentage=70)
session.set_do_like(enabled=True, percentage=100)
session.set_comments(["Curto bastante o que postam, Vem visitar a gente no @clubedelider",
"Que LEGAAAAAAAAL", "Que legaaal :)", "Tá faltando mais isso na internet :)", "Deus abencoe", "MARANATA!", "Saudacoes do @clubedelider", "hahaaahahahh", "Parabens pelo trabalho",
"Amem!","Aguardando a volta de cristo","Que ministerio incrivel","Deus lhe guarde","Padrao de qualidade maximo sempre :)","CLASSE A - Muito bom", "Otimo!","Saudades...","O amor de Cristo nos motiva","So gente boa","Glória Deus", "Sempre curto as postagens, continue sempre !"
])
session.set_do_comment(enabled=True, percentage=100)
session.interact_user_followers(['desbravadores'], amount=600, randomize=True)
#prertonkohler
exit(1)
session.like_by_tags(['liderdesbravador', 'liderdesbravadores',
'desbravador','desbravadores','campori'
'desbravadora', 'desbravadoras'], amount=800)
#likes specified amount of posts for each location in the array
#in this case: 100 posts geotagged at the chrysler building and 100 posts geotagged at the salton sea
#session.like_by_locations(['26429/chrysler-building/', '224442573/salton-sea/'], amount=100)
#gets tags from image passed as instagram-url and likes specified amount of images for each tag
#session.like_from_image(url='www.instagram.com/p/BSrfITEFUAM/', amount=100)
#likes 100 posts for each tag of your latest image
#session.like_from_image(amount=100)
#likes 50 photos of other animals
#session.like_by_tags(['#adventista'], amount=50, media='Photo')
#session.like_from_image(url='www.instagram.com/image', amount=50, media='Photo')
#likes 15 videos of cats
##session.like_by_tags(['#desbravadores'], amount=15, media='Video')
##session.like_from_image(url='www.instagram.com/image', amount=15, media='Video')
##session.like_by_tags(['#desbravadora'], amount=15, media='Video')
##session.like_from_image(url='www.instagram.com/image', amount=15, media='Video')
#accs = ['desbravadoresdsa','camporidsa']
#session.follow_by_list(accs, times=1)
#session.set_do_follow(enabled=True, percentage=10, times=2)
#session.follow_user_followers(['desbravadoresdsa'], amount=10, randomize=False, sleep_delay=60)
#session.follow_by_tags(['desbravadores','desbravadora'], amount=10)
#session.unfollow_users(amount=200, onlyNotFollowMe=True, sleep_delay=50)
session.end()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment