Skip to content

Instantly share code, notes, and snippets.

@kevinjnguyen
Created January 22, 2020 02:33
Show Gist options
  • Save kevinjnguyen/c4df654654076bbfc4b051ac80b0730e to your computer and use it in GitHub Desktop.
Save kevinjnguyen/c4df654654076bbfc4b051ac80b0730e to your computer and use it in GitHub Desktop.
Instaloader Get Hashtag Post Summary Example
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