Skip to content

Instantly share code, notes, and snippets.

@rickithadi
Created April 1, 2019 16:51
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rickithadi/005f3a8325291cac101c38b677bf5cfa to your computer and use it in GitHub Desktop.
Save rickithadi/005f3a8325291cac101c38b677bf5cfa to your computer and use it in GitHub Desktop.
simple script to degeneracy
from instapy import InstaPy
from instapy import smart_run
import random
import requests
import json
import schedule
import time
# get a session!
def gen_comment():
rando=requests.get('https://en.wikipedia.org/api/rest_v1/page/random/summary')
parsed=rando.json()
return parsed['extract']
# let's go! :>
while True:
session = InstaPy(username='',
password='',
use_firefox=True,
headless_browser=True)
with smart_run(session):
comments = []
for x in range(30):
comments.append(gen_comment())
hashtags = ['singapore', 'sg', 'dev',
'webdev',
'react', 'javascript', 'code',
'angular', 'typescipt', 'linux',
'fsf', 'yanggang', 'F4F',
'lifting', 'strong',
'F4F', 'gym', 'beautifuldestinations',
'thegreatoutdoors']
random.shuffle(hashtags)
my_hashtags = hashtags[:10]
# general settings
session.set_do_follow(enabled=True, percentage=40, times=1)
session.set_do_comment(enabled=True, percentage=100)
session.set_do_like(True, percentage=70)
session.set_quota_supervisor(enabled=True, peak_comments=(21, 240))
session.set_delimit_liking(enabled=True, max=100, min=0)
session.set_relationship_bounds(enabled=True,
potency_ratio=None,
delimit_by_numbers=True,
max_followers=3000,
max_following=2000,
min_followers=100,
min_following=50)
session.set_comments(
comments,
media='Photo')
session.set_user_interact(amount=1, randomize=False, percentage=40)
# activity
session.like_by_tags(my_hashtags, amount=60, media=None)
session.unfollow_users(amount=500, InstapyFollowed=(True, "nonfollowers"),
style="FIFO",
unfollow_after=12 * 60 * 60, sleep_delay=501)
session.unfollow_users(amount=500, InstapyFollowed=(True, "all"),
style="FIFO", unfollow_after=24 * 60 * 60,
sleep_delay=501)
@rickithadi
Copy link
Author

note that indentation is a bit off after the for loop. Only comments.append(gen_comment()) is supposed to be looped

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment