Skip to content

Instantly share code, notes, and snippets.

@dev4Fun
Created September 10, 2020 03:27
Show Gist options
  • Save dev4Fun/3e006d2771415fb6d8cd1fd6d32fcf04 to your computer and use it in GitHub Desktop.
Save dev4Fun/3e006d2771415fb6d8cd1fd6d32fcf04 to your computer and use it in GitHub Desktop.
def like_from_explore(self):
max_id = 0
while True:
try:
posts = self.fetch_posts_from_explore(max_id)
except TimeoutException:
continue
random.shuffle(posts)
for post in posts:
if self.post_filter.should_like(post):
self.like_post(post)
if not self.running_strategy.should_continue_run():
return
else:
post_tracker.skipped_post(post)
max_id += 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment