Created
September 10, 2020 03:27
-
-
Save dev4Fun/3e006d2771415fb6d8cd1fd6d32fcf04 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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