Guest User

Untitled

a guest
Jan 1st, 2019
204
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. from instapy import InstaPy
  2. from instapy.util import smart_run
  3. from flask import Flask
  4.  
  5.  
  6. app = Flask(__name__)
  7. # login credentials
  8. insta_username = ''
  9. insta_password = ''
  10.  
  11. # get an InstaPy session!
  12. # set headless_browser=True to run InstaPy in the background
  13. session = InstaPy(username=insta_username,
  14. password=insta_password,
  15. headless_browser=True,
  16. nogui=True)
  17.  
  18. @app.route('/')
  19. def index():
  20. with smart_run(session):
  21. """ Activity flow """
  22. # settings
  23. session.set_relationship_bounds(
  24. enabled=True,
  25. delimit_by_numbers=True,
  26. max_followers=4590,
  27. min_followers=45,
  28. min_following=77)
  29.  
  30. # actions
  31. session.like_by_tags(["natgeo"], amount=10)
  32.  
  33. return 'Done'
Add Comment
Please, Sign In to add comment