Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added timing randomisation #7

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 25 additions & 5 deletions webstagrambot.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
- make sure you have the pycurl library installed
- log into web.stagram.com with your instagram account and approve the app
- edit between lines 42 and 52
- from the command line, run "python webstagram.py"
- from the command line, run "python webstagrambot.py"
- enjoy!

v1.0 updates:
Expand All @@ -29,21 +29,33 @@
*** thank you Nick, John, Max, Shahar, Charlie for the help
'''

'''
Edited by Joel Mackenzie, December 2013.
Implemented random time delay between likes.
Tested Dec 22 2013
'''

import os
import pycurl
import cStringIO
import re
import random
import time

#for timing
random.seed()



##### EDIT THESE BELOW

# your instagram username and password
username = "username"
password = "password"
username = "yourusernamehere"
password = "yourpasswordhere"

#set a sleep timer between each like. Set value to 0 if you don't want it to sleep at all
sleeptimer = 5
#Random interval range. Time between likes will be between upper and lower.
lower = 17
upper = 33

#set a like limit per hashtag. Set value to 0 if you don't want a limit
hashtaglikelimit = 100
Expand All @@ -53,11 +65,14 @@

##### NO NEED TO EDIT BELOW THIS LINE



browsers = ["IE ","Mozilla/","Gecko/","Opera/","Chrome/","Safari/"]
operatingsystems = ["Windows","Linux","OS X","compatible","Macintosh","Intel"]

def login():
try:

os.remove("pycookie.txt")
except:
pass
Expand Down Expand Up @@ -166,6 +181,7 @@ def like():
if len(likedata)>0:
for imageid in likedata:
if hashtaglikelimit > 0 and hashtaglikes >= hashtaglikelimit:
print "breaka"
break
repeat = True
while repeat:
Expand Down Expand Up @@ -197,6 +213,10 @@ def like():
print "You liked #"+tag+" image "+imageid+"! Like count: "+str(likecount)
repeat = False
sleepcount = 0

#Pulls a random integer out between lower and upper
sleeptimer = random.randint(lower, upper)
print "Waiting " + str(sleeptimer) + " seconds before liking another image\n"
if sleeptimer > 0:
time.sleep(sleeptimer)
else:
Expand Down