def WayneWashington(username, password, delay, hashtags, compliments, b=None):
if(b==None):
b = Bot(username, password)
while(True):
try:
#get the media for a random hashtag
tag = hashtags[randint(0,len(hashtags)-1)].strip()
media = b.get_media_from_hashtag(tag)
#iterate through, like all and comment on a few
for i in range(len(media)):
b.like(media[i]['id'], tag)
time.sleep(1)
if(randint(0,9) == 0):
b.comment(compliments[randint(0, len(compliments)-1)], media[i]['id'], tag)
time.sleep(1)
time.sleep(randint(delay-5,delay+5))
except Exception as e:
print(str(e))
time.sleep(delay)
评论列表
文章目录