Hey Guys,
I thought its about time I give something back to the community so here it goes. This is a Python script that I edited and added to after finding it on GitHub. I used to use this script to automate my liking activity back when I first got started out with IG almost 2 years ago. It is intended to be run on a single account with no proxy support (probably best for beginners wanting a little IG juice before jumping into bots). I don't use it much anymore due to a more robust bot I have but am sure someone will find it useful. So here's how to get started!
1) Install Python on your computer (great news, Macs and Linux boxes are good to go! Windows users, hit some YouTube tuts and come right back)
2) Save the code below somewhere on your computer and give it a name with a .py suffix. (e.g. pythonliker.py) << very important.
3) Edit the code for you to use. I intentionally set it to be VERY safe. Input the tags you want to like in the TAGS variable, adjust the max_sec for upper threshold of liking pause, adjust the number under #TIME RANDOMIZER in the likeusers function for the lower threshold of the liking pause. Edit the max_count variable for the max numbers of photos you will like per tag. Use the URL at the top of the script to get your auth token; ensure you are not singed into any IG accounts, put that URL in your browser, log in and authorize the account you want to automate, grab the access_token string that is returned in the URL bar and place it in the auth_token variable below. Save the file.
4) Open up a terminal, traverse to the directory where you stored your file and execute it! (for example, if you are on a mac or linux box and you saved it to your desktop your would issue the following commands in terminal:
cd desktop
python pythonliker.py )
5) You will see the text Starting Auto Liking Script in the terminal window followed by a URL and the number of seconds the script paused between likes. You can now sit back and enjoy, just don't let your computer turn off or the script will stop.
Hope someone finds this useful! BHW FTW!
I thought its about time I give something back to the community so here it goes. This is a Python script that I edited and added to after finding it on GitHub. I used to use this script to automate my liking activity back when I first got started out with IG almost 2 years ago. It is intended to be run on a single account with no proxy support (probably best for beginners wanting a little IG juice before jumping into bots). I don't use it much anymore due to a more robust bot I have but am sure someone will find it useful. So here's how to get started!
1) Install Python on your computer (great news, Macs and Linux boxes are good to go! Windows users, hit some YouTube tuts and come right back)
2) Save the code below somewhere on your computer and give it a name with a .py suffix. (e.g. pythonliker.py) << very important.
3) Edit the code for you to use. I intentionally set it to be VERY safe. Input the tags you want to like in the TAGS variable, adjust the max_sec for upper threshold of liking pause, adjust the number under #TIME RANDOMIZER in the likeusers function for the lower threshold of the liking pause. Edit the max_count variable for the max numbers of photos you will like per tag. Use the URL at the top of the script to get your auth token; ensure you are not singed into any IG accounts, put that URL in your browser, log in and authorize the account you want to automate, grab the access_token string that is returned in the URL bar and place it in the auth_token variable below. Save the file.
4) Open up a terminal, traverse to the directory where you stored your file and execute it! (for example, if you are on a mac or linux box and you saved it to your desktop your would issue the following commands in terminal:
cd desktop
python pythonliker.py )
5) You will see the text Starting Auto Liking Script in the terminal window followed by a URL and the number of seconds the script paused between likes. You can now sit back and enjoy, just don't let your computer turn off or the script will stop.
Hope someone finds this useful! BHW FTW!
Code:
import time, random, urllib, json, urllib2
#Hashtags to like on
TAGS = ["like4like", "20likes"]
#Max number of likes per hashtag
max_count = 20
#Max seconds to wait between likes
max_sec = 100
#Use this url to get the auth_token
# https://api.instagram.com/oauth/authorize/?client_id=1627c123e3fc481791e0d6be16ff57a0&redirect_uri=http://smallhours.fm&response_type=token&display=touch&scope=likes+relationships
#Input access_token string from URL into auth_token
auth_token = ' PLACE ACCESS_TOKEN HERE '
client_id = '1627c123e3fc481791e0d6be16ff57a0'
user_agent = 'Mozilla/5.0 (iPhone; U; CPU iPhone OS 4_0 like Mac OS X; en-us) AppleWebKit/532.9 (KHTML, like Gecko) Version/4.0.5 Mobile/8A293 Safari/6531.22.7'
headers = {'User-Agent': user_agent,
"Content-type": "application/x-www-form-urlencoded"
}
likedDict = {}
print "Starting Auto Liking Script"
def likePicture(pictureId):
liked = 0
try:
urlLike = "https://api.instagram.com/v1/media/%s/likes"
values = {'access_token': auth_token,
'client_id': client_id}
newLike = urlLike % (pictureId)
print newLike
data = urllib.urlencode(values)
req = urllib2.Request(newLike, data, headers)
response = urllib2.urlopen(req)
result = response.read()
dataObj = json.loads(result)
liked += 1
except Exception, e:
print e
return liked
def likeUsers(max_results, max_id, tag, c):
global paginationId
urlFindLike = "https://api.instagram.com/v1/tags/%s/media/recent?client_id=9e262d946e4f4d9987885588669e8b4f&access_token=%s" % (
tag, auth_token)
urlLike = "https://api.instagram.com/v1/media/%s/likes"
values = {'access_token': auth_token,
'client_id': client_id,
'max_id': max_id}
f = urllib.urlopen(urlFindLike)
dataObj = json.loads(f.read())
f.close()
numResults = len(dataObj['data'])
pictureId = 0
for likeObj in dataObj['data']:
print ''
pictureId = likeObj['id']
paginationId = dataObj['pagination']['next_max_id']
user = likeObj['user']
userId = user['id']
try:
numLikes = likedDict[pictureId]
numLikes = numLikes + 1
likedDict[pictureId] = numLikes
except:
numLikes = 1
likedDict[pictureId] = numLikes
try:
result = likePicture(pictureId)
c = c + result
seconds = max_sec
#TIME RANDOMIZER
seconds=random.randint(35, max_sec)
print "Sleeping %s Seconds" % (seconds)
time.sleep(seconds)
if (c % 10 == 0):
print "Liked %s: %s" % (tag, c)
if (c == max_results):
break
except Exception, e:
print e
if (c != max_results):
likeUsers(max_results, paginationId, tag, c)
return c
for tag in TAGS:
c = 0
c = likeUsers(max_count, 0, tag, c)
print "Liked: %s for tag %s" % (c, tag)
for likes in likedDict:
print "%s = %s" % (likes, likedDict[likes])