Skip to content

Instantly share code, notes, and snippets.

@santocyber
Created May 26, 2018 02:27
Show Gist options
  • Save santocyber/4572c3f65e7d14f487a06055cf79a0a2 to your computer and use it in GitHub Desktop.
Save santocyber/4572c3f65e7d14f487a06055cf79a0a2 to your computer and use it in GitHub Desktop.
# -*- coding: utf-8 -*-
import os
import time
import sys
reload(sys)
sys.setdefaultencoding('utf8')
from tempfile import gettempdir
from selenium.common.exceptions import NoSuchElementException
from instapy import InstaPy
insta_username = 'frutashugreen'
insta_password = 'xxx'
referencia = ['mundoverde_brasil','revistavegetarianos','riosunset','carioquissimo','adorofarm','021rio','presuntovegetariano','paulagandin','nutricionistarodolfoperes','ondeirnorio','rachelc00k']
referenciatags = ['frutas','saude','vida','health','fitness','foodporn']
referenciafotos = ['https://www.instagram.com/p/Bhysf3lg1La/?taken-by=redeglobo', 'https://www.instagram.com/p/Bga_UUrDFoc/', 'https://www.instagram.com/p/BgbOtLHD7yp/?taken-by=natgeo']
# set these in instapy/settings.py if you're locating the
# library in the /usr/lib/pythonX.X/ directory:
# Settings.database_location = '/path/to/instapy.db'
# Settings.chromedriver_location = '/path/to/chromedriver'
print (insta_username, "HUGREEN BOT START")
session = InstaPy(username=insta_username, password=insta_password, headless_browser=True, multi_logs=True, nogui=True,use_firefox=False, bypass_suspicious_attempt=True)
print "Session HUGREEN BOT LOGIN"
session.login()
print "Session HUGREEN BOT LOGGED"
while True:
print "Session HUGREEN SETS"
#SETTINGS SESSION HUGREEN
session.set_relationship_bounds(enabled=True, potency_ratio=5, delimit_by_numbers=True, max_followers=900000000000, max_following=5000000000, min_followers=1, min_following=0)
# session.set_dont_unfollow_active_users(enabled=True, posts=5)
print "Session HUGREEN UNFOLLOW"
session.unfollow_users(amount=80,onlyInstapyFollowed = True, onlyInstapyMethod = 'LIFO', onlyNotFollowMe=False, sleep_delay=450)
print "Session Segue as referencias"
session.follow_by_list(referencia, times=1)
print "Session HUGREEN FOLLOW"
session.follow_user_followers(referencia, amount=5, randomize=False, interact=True)
print "Session HUGREEN POUSE 30min"
time.sleep(1800)
session.follow_by_tags(referenciatags, amount=5)
print "Session HUGREEN POUSE 1H"
time.sleep(1800)
session.follow_user_likers (referencia, photos_grab_amount = 5, follow_likers_per_photo = 4, randomize=True)
print "Session HUGREEN POUSE 1H"
time.sleep(1800)
print "Session HUGREEN UNFOLLOW"
session.unfollow_users(amount=80,onlyInstapyFollowed = True, onlyInstapyMethod = 'FIFO', onlyNotFollowMe=False, sleep_delay=450)
#Hugreen bt Location
# session.comment_by_locations(['224442573/salton-sea/'], amount=100)
# session.like_by_locations(['224442573/salton-sea/'], amount=100)
print "Session HUGREEN Interagem com as referencias"
session.set_user_interact(amount=2, randomize=True, percentage=70, media='Photo')
session.set_user_interact(amount=2, percentage=70, media='Video')
session.set_do_follow(enabled=True, percentage=10)
session.set_do_like(enabled=True, percentage=90)
session.set_comments(["☺️", "❤️","😍"])
session.set_do_comment(enabled=False, percentage=5)
session.interact_by_users(referencia, amount=2, randomize=True, media='Photo')
session.interact_by_users(referencia, amount=2, randomize=True, media='Video')
print "Session HUGREEN POUSE 30min"
time.sleep(1800)
print "Session HUGREEN UNFOLLOW"
session.unfollow_users(amount=80, onlyInstapyFollowed = True, onlyInstapyMethod = 'FIFO', onlyNotFollowMe=True, sleep_delay=450)
print "Session HUGREEN POUSE 30min"
time.sleep(1800)
print "Session HUGREEN LIKES"
session.like_by_feed(amount=10, randomize=True, interact=True)
print "Session HUGREEN POUSE 1H"
time.sleep(1800)
session.like_by_users(usernames=referencia, amount=10)
print "Session HUGREEN POUSE 1H"
time.sleep(1800)
session.like_by_tags(referenciatags, amount=10, interact=True)
print "Session HUGREEN POUSE 1H"
time.sleep(1800)
print "Session HUGREEN UNFOLLOW"
session.unfollow_users(amount=80, onlyInstapyFollowed = True, onlyInstapyMethod = 'FIFO', onlyNotFollowMe=True, sleep_delay=450)
print "Session HUGREEN Interagem com os seguidores da referencia"
session.set_user_interact(amount=3, randomize=True, percentage=70, media='Photo')
session.set_user_interact(amount=3, percentage=70, media='Video')
session.set_do_follow(enabled=True, percentage=95)
session.set_do_like(enabled=True, percentage=95)
session.set_comments(["☺️", "❤️","😍"])
session.set_do_comment(enabled=True, percentage=80)
session.interact_user_followers(referencia, amount=10, randomize=True)
print "Session HUGREEN POUSE 30min"
time.sleep(1800)
print "Session HUGREEN UNFOLLOW"
session.unfollow_users(amount=80, onlyInstapyFollowed = True, onlyInstapyMethod = 'FIFO', onlyNotFollowMe=True, sleep_delay=450)
# end the bot session
# session.end()
print "HUGREEN Session END"
time.sleep(100)
print "HUGREEN BOT RESTART LOOPING"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment