Skip to content

Instantly share code, notes, and snippets.

@dev4Fun
Last active February 7, 2020 04:24
Show Gist options
  • Select an option

  • Save dev4Fun/3f56c53b2e34017f36d130e6a83e5004 to your computer and use it in GitHub Desktop.

Select an option

Save dev4Fun/3f56c53b2e34017f36d130e6a83e5004 to your computer and use it in GitHub Desktop.
def _process_comments(self, comments):
num_of_replies = round(len(comments) * 0.35)
comments_to_leave = iter(random.sample(comment_reply_list, num_of_replies + 1))
for comment in random.sample(comments, num_of_replies):
comment.upvote()
sleep(random.randint(2, 3))
comment.reply(next(comments_to_leave, random.choice(comment_reply_list)))
return num_of_replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment