Created
January 22, 2020 02:33
-
-
Save kevinjnguyen/c4df654654076bbfc4b051ac80b0730e to your computer and use it in GitHub Desktop.
Instaloader Get Hashtag Post Summary Example
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
loader = Instaloader() | |
NUM_POSTS = 10 | |
def get_hashtags_posts(query): | |
posts = loader.get_hashtag_posts(query) | |
users = {} | |
count = 0 | |
for post in posts: | |
profile = post.owner_profile | |
if profile.username not in users: | |
summary = engagement.get_summary(profile) | |
users[profile.username] = summary | |
count += 1 | |
print('{}: {}'.format(count, profile.username)) | |
if count == NUM_POSTS: | |
break | |
return users |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment